Package net.opengis.gml

Examples of net.opengis.gml.TimePositionType


        List<Node> timePositions = node.getChildren("timePosition");
        TimeSequenceType results = Wcs10Factory.eINSTANCE.createTimeSequenceType();
       
        if (timePositions != null && !timePositions.isEmpty()) {
            for (Node timePositionNode : timePositions) {
                TimePositionType timePosition = Gml4wcsFactory.eINSTANCE.createTimePositionType();
                Date positionDate = ((Position) timePositionNode.getValue()).getDate();
                timePosition.setValue(positionDate);
                results.getTimePosition().add(timePosition);
            }

            return results;
        } else {
            List<Node> timePeriods = node.getChildren("timePeriod");
            if (timePeriods != null && !timePeriods.isEmpty()) {
                for (Node timePeriodNode : timePeriods) {
                    Instant begining = new DefaultInstant((Position) timePeriodNode.getChild("beginPosition").getValue());
                    Instant ending = new DefaultInstant((Position) timePeriodNode.getChild("endPosition").getValue());

                    //Period timePeriod = new DefaultPeriod(begining, ending);
                    TimePeriodType timePeriod = Wcs10Factory.eINSTANCE.createTimePeriodType();
                    TimePositionType beginPosition = Gml4wcsFactory.eINSTANCE.createTimePositionType();
                    TimePositionType endPosition = Gml4wcsFactory.eINSTANCE.createTimePositionType();
                   
                    beginPosition.setValue(begining.getPosition().getDate());
                    endPosition.setValue(ending.getPosition().getDate());
                   
                    timePeriod.setBeginPosition(beginPosition);
                    timePeriod.setEndPosition(endPosition);

                    results.getTimePeriod().add(timePeriod);
View Full Code Here


   * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
   * @generated
   */
    public NotificationChain basicSetBeginPosition(TimePositionType newBeginPosition, NotificationChain msgs) {
    TimePositionType oldBeginPosition = beginPosition;
    beginPosition = newBeginPosition;
    if (eNotificationRequired()) {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Wcs10Package.TIME_PERIOD_TYPE__BEGIN_POSITION, oldBeginPosition, newBeginPosition);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
View Full Code Here

   * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
   * @generated
   */
    public NotificationChain basicSetEndPosition(TimePositionType newEndPosition, NotificationChain msgs) {
    TimePositionType oldEndPosition = endPosition;
    endPosition = newEndPosition;
    if (eNotificationRequired()) {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Wcs10Package.TIME_PERIOD_TYPE__END_POSITION, oldEndPosition, newEndPosition);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
View Full Code Here

        if (time != null && time instanceof TimeSequenceType) {
            timeSequence = (TimeSequenceType) time;
        } else if (time != null && time instanceof List) {
            timeSequence = Wcs10Factory.eINSTANCE.createTimeSequenceType();
            for (Date tPos : (List<Date>) time) {
                final TimePositionType timePosition = Gml4wcsFactory.eINSTANCE
                        .createTimePositionType();
                timePosition.setValue(tPos);
                timeSequence.getTimePosition().add(timePosition);
            }
        }
        if (timeSequence == null && bbox == null)
            throw new WcsException("Bounding box cannot be null, TIME has not been specified",
View Full Code Here

                final List<Object> timeValues = new ArrayList<Object>();
                if (temporalSubset != null && temporalSubset.getTimePosition() != null) {
                    // grab the time positions
                    final EList timePosition = temporalSubset.getTimePosition();
                    for (Iterator it = timePosition.iterator(); it.hasNext();) {
                        TimePositionType tp = (TimePositionType) it.next();
                        Date date = (Date) tp.getValue();
                        if(date == null) {
                            date = dimensions.getMaxTime();
                        }
                        timeValues.add(date);
                    }
                    // grab the time intervals
                    final EList timePeriods = temporalSubset.getTimePeriod();
                    for (Iterator it = timePeriods.iterator(); it.hasNext();) {
                        TimePeriodType tp = (TimePeriodType) it.next();
                        Date begin = (Date) tp.getBeginPosition().getValue();
                        Date end = (Date) tp.getEndPosition().getValue();
                        timeValues.add(new DateRange(begin, end));
                    }
                }
               
                if(timeValues.isEmpty()) {
View Full Code Here

     * @param timeSequence
     * @param tPos
     */
    private void addToTimeSequence(TimeSequenceType timeSequence, Object tPos) {
        if(tPos instanceof Date) {
            final TimePositionType timePosition =
                Gml4wcsFactory.eINSTANCE.createTimePositionType();
            timePosition.setValue(tPos);
            timeSequence.getTimePosition().add(timePosition);
        } else if(tPos instanceof DateRange){
            DateRange range = (DateRange) tPos;
            final TimePeriodType timePeriod = Wcs10Factory.eINSTANCE.createTimePeriodType();
            final TimePositionType start = Gml4wcsFactory.eINSTANCE.createTimePositionType();
            start.setValue(range.getMinValue());
            timePeriod.setBeginPosition(start);
            final TimePositionType end = Gml4wcsFactory.eINSTANCE.createTimePositionType();
            end.setValue(range.getMaxValue());
            timePeriod.setEndPosition(end);
            timeSequence.getTimePeriod().add(timePeriod);
        }
    }
View Full Code Here

TOP

Related Classes of net.opengis.gml.TimePositionType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.