Package org.opengis.temporal

Examples of org.opengis.temporal.Instant


    // 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


     *
     * @generated modifiable
     */
    public Object parse(ElementInstance instance, Node node, Object value) throws Exception {

        Instant begin = null, end = null;
        if (node.hasChild("begin")) {
            begin = (Instant) node.getChildValue("begin");
        }
        else {
            begin = (Instant) node.getChildValue("beginPosition");
View Full Code Here

        Duration result = temporalGeomericPrimitive1.distance(other);
        assertFalse(temporalGeomericPrimitive2.distance(other).equals(result));

        //calcul Distance with instant and period
        cal.set(2009, 1, 1);
        Instant i1 = new DefaultInstant(new DefaultPosition(cal.getTime()));
        cal.set(2012, 1, 1);
        Instant i2 = new DefaultInstant(new DefaultPosition(cal.getTime()));
        other = new DefaultPeriod(i1, i2);
        result = temporalGeomericPrimitive1.distance(other);
        assertFalse(temporalGeomericPrimitive2.distance(other).equals(result));

        //calcul Distance between Period objects
View Full Code Here

    @Before
    public void setUp() {
        Calendar cal = Calendar.getInstance();
        cal.set(1995, 1, 1);
        Instant begining1 = new DefaultInstant(new DefaultPosition(cal.getTime()));
        cal.set(2000, 1, 1);
        Instant ending1 = new DefaultInstant(new DefaultPosition(cal.getTime()));
        cal.set(2000, 1, 1);
        Instant begining2 = new DefaultInstant(new DefaultPosition(cal.getTime()));
        cal.set(2012, 1, 1);
        Instant ending2 = new DefaultInstant(new DefaultPosition(cal.getTime()));
        period1 = new DefaultPeriod(begining1, ending1);
        period2 = new DefaultPeriod(begining2, ending2);
    }
View Full Code Here

    /**
     * Test of getBeginning method, of class DefaultPeriod.
     */
    @Test
    public void testGetBeginning() {
        Instant result = period1.getBeginning();
        assertFalse(period2.getBeginning().equals(result));
    }
View Full Code Here

    /**
     * Test of setBegining method, of class DefaultPeriod.
     */
    @Test
    public void testSetBegining_Instant() {
        Instant result = period1.getBeginning();
        Instant newInstant = new DefaultInstant(new DefaultPosition(new Date()));
        ((DefaultPeriod) period1).setBegining(newInstant);
        assertFalse(period1.getBeginning().equals(result));
    }
View Full Code Here

    /**
     * Test of getEnding method, of class DefaultPeriod.
     */
    @Test
    public void testGetEnding() {
        Instant result = period1.getEnding();
        assertFalse(period2.getEnding().equals(result));
    }
View Full Code Here

    /**
     * Test of setEnding method, of class DefaultPeriod.
     */
    @Test
    public void testSetEnding_Instant() {
        Instant result = period1.getEnding();
        Instant newInstant = new DefaultInstant(new DefaultPosition(new Date()));
        ((DefaultPeriod) period1).setEnding(newInstant);
        assertFalse(period1.getEnding().equals(result));
    }
View Full Code Here

        other = new DefaultInstant(position);
        RelativePosition result = temporalPrimitive1.relativePosition(other);
        assertFalse(temporalPrimitive2.relativePosition(other).equals(result));

        //relative position between Instant and Period
        Instant instant1 = new DefaultInstant(new DefaultPosition(cal.getTime()));
        Instant instant2 = (DefaultInstant) temporalPrimitive2;

        other = new DefaultPeriod(instant1, instant2);
        result = temporalPrimitive1.relativePosition(other);
        assertFalse(temporalPrimitive2.relativePosition(other).equals(result));
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

TOP

Related Classes of org.opengis.temporal.Instant

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.