Package org.geotools.temporal.object

Examples of org.geotools.temporal.object.DefaultInstant


    protected Date date(String date) throws ParseException {
        return df.parse(date);
    }

    protected Instant instant(String d) throws ParseException {
        return new DefaultInstant(new DefaultPosition(date(d)));
    }
View Full Code Here


        startDate = HDF4Utilities.getDateTime(startTime, HDF4Utilities.TERASCAN_DATETIME_FORMAT);
        endDate = HDF4Utilities.getDateTime(endTime, HDF4Utilities.TERASCAN_DATETIME_FORMAT);
        break;
      }
    if (startDate != null)
      startInstant = new DefaultInstant(new DefaultPosition(startDate));
    if (endDate != null
      endInstant = new DefaultInstant(new DefaultPosition(endDate));

    final String timeOrigin = startInstant.getPosition().getDateTime().toString();
    tCRS.addAxis(new Identification("TIME"), "future", "hours since "+ timeOrigin, null);
        tCRS.addOrigin(timeOrigin);
    }
View Full Code Here

    // use the default implementations from gt-main

    DateFormat FORMAT = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
    Date date1 = FORMAT.parse("2001-07-05T12:08:56.235-0700");
    Instant temporalInstant = new DefaultInstant(new DefaultPosition(date1));

    // Simple check if property is after provided temporal instant
    Filter after = ff.after(ff.property("date"), ff.literal(temporalInstant));

    // can also check of property is within a certain period
    Date date2 = FORMAT.parse("2001-07-04T12:08:56.235-0700");
    Instant temporalInstant2 = new DefaultInstant(new DefaultPosition(date2));
    Period period = new DefaultPeriod(temporalInstant, temporalInstant2);

    Filter within = ff.toverlaps(ff.property("constructed_date"),
            ff.literal(period));
    // temporal end
View Full Code Here

    protected Date date(String date) throws ParseException {
        return FORMAT.parse(date);
    }

    protected Instant instant(String d) throws ParseException {
        return new DefaultInstant(new DefaultPosition(date(d)));
    }
View Full Code Here

     *
     * @generated modifiable
     */
    public Object parse(ElementInstance instance, Node node, Object value) throws Exception {
        Position pos = (Position) node.getChildValue(Position.class);
        return new DefaultInstant(pos);
    }
View Full Code Here

        String frameName = ((URI) node.getAttributeValue("frame", "#ISO-8601")).toString();
        NamedIdentifier frameID = new NamedIdentifier(Citations.CRS, frameName);
        TemporalReferenceSystem frame = new DefaultTemporalReferenceSystem(frameID, null);

        Instant begining = new DefaultInstant((Position) node.getChild("BeginPosition").getValue());
        Instant ending = new DefaultInstant((Position) node.getChild("EndPosition").getValue());

        Period timePeriod = new DefaultPeriod(begining, ending);

        return timePeriod;
    }
View Full Code Here

            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 = Wcs111Factory.eINSTANCE.createTimePeriodType();
                    Date beginPosition = cvtToGmt(begining.getPosition().getDate());
                    Date endPosition = cvtToGmt(ending.getPosition().getDate());
                   
                    timePeriod.setBeginPosition(beginPosition);
                    timePeriod.setEndPosition(endPosition);

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

        String frameName = ((URI) node.getAttributeValue("frame", "#ISO-8601")).toString();
        NamedIdentifier frameID = new NamedIdentifier(Citations.CRS, frameName);
        TemporalReferenceSystem frame = new DefaultTemporalReferenceSystem(frameID, null);

        Instant begining = new DefaultInstant((Position) node.getChild("BeginPosition").getValue());
        Instant ending = new DefaultInstant((Position) node.getChild("EndPosition").getValue());

        Period timePeriod = new DefaultPeriod(begining, ending);

        return timePeriod;
    }
View Full Code Here

            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 = Wcs111Factory.eINSTANCE.createTimePeriodType();
                    Date beginPosition = cvtToGmt(begining.getPosition().getDate());
                    Date endPosition = cvtToGmt(ending.getPosition().getDate());
                   
                    timePeriod.setBeginPosition(beginPosition);
                    timePeriod.setEndPosition(endPosition);

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

TOP

Related Classes of org.geotools.temporal.object.DefaultInstant

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.