Package org.opengis.temporal

Examples of org.opengis.temporal.Period


        Ends before = ff.ends(ff.property(aname("dt")), ff.literal(period));
        assertDatesMatch(before, "2009-06-28 15:12:41");
    }
   
    public void testEndedBy() throws Exception {
        Period period = period("2009-01-15 13:10:12", "2009-06-28 15:12:41");
        FilterFactory ff = dataStore.getFilterFactory();
       
        Ends before = ff.ends(ff.property(aname("dt")), ff.literal(period));
        assertDatesMatch(before, "2009-06-28 15:12:41");
    }
View Full Code Here


        Ends before = ff.ends(ff.property(aname("dt")), ff.literal(period));
        assertDatesMatch(before, "2009-06-28 15:12:41");
    }
   
    public void testDuring() throws Exception {
        Period period = period("2009-01-01 00:00:00", "2009-07-28 15:12:41");
        FilterFactory ff = dataStore.getFilterFactory();
       
        During during = ff.during(ff.property(aname("dt")), ff.literal(period));
        assertDatesMatch(during, "2009-01-15 13:10:12", "2009-06-28 15:12:41");
    }
View Full Code Here

        During during = ff.during(ff.property(aname("dt")), ff.literal(period));
        assertDatesMatch(during, "2009-01-15 13:10:12", "2009-06-28 15:12:41");
    }
   
    public void testTContains() throws Exception {
        Period period = period("2009-01-01 00:00:00", "2009-07-28 15:12:41");
        FilterFactory ff = dataStore.getFilterFactory();
       
        TContains during = ff.tcontains(ff.literal(period), ff.property(aname("dt")));
        assertDatesMatch(during, "2009-01-15 13:10:12", "2009-06-28 15:12:41");
    }
View Full Code Here

        if (attType != null) {
            typeContext = attType.getType().getBinding();
        }
       
        //check for time period
        Period period = null;
        if (temporal.evaluate(null) instanceof Period) {
            period = (Period) temporal.evaluate(null);
        }

        //verify that those filters that require a time period have one
View Full Code Here

        else if (literal instanceof Date ){
            return dateToText( (Date) literal, output );
        }
        else if (literal instanceof Period){

            Period period = (Period) literal;
           
            output = dateToText( period.getBeginning().getPosition().getDate(), output );
            output.append("/");
        output = dateToText( period.getEnding().getPosition().getDate(), output );
       
        return output;
        }
        else {
            String escaped = literal.toString().replaceAll("'", "''");
View Full Code Here

        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

     *      org.w3c.dom.Document, org.w3c.dom.Element)
     */
    @Override
    public Element encode(Object object, Document document, Element value)
            throws Exception {
        Period timePeriod = (Period) object;

        if (timePeriod == null) {
            value.appendChild(document.createElementNS(GML.NAMESPACE, GML.Null.getLocalPart()));
        }

View Full Code Here

        return null;
    }

    public Object getProperty(Object object, QName name) {
        Period timePeriod = (Period) object;

        if (timePeriod == null) {
            return null;
        }

        if (name.getLocalPart().equals("BeginPosition")) {
            return timePeriod.getBeginning().getPosition();
        }

        if (name.getLocalPart().equals("EndPosition")) {
            return timePeriod.getEnding().getPosition();
        }

        return null;
    }
View Full Code Here

        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

     *      org.w3c.dom.Document, org.w3c.dom.Element)
     */
    @Override
    public Element encode(Object object, Document document, Element value)
            throws Exception {
        Period timePeriod = (Period) object;

        if (timePeriod == null) {
            value.appendChild(document.createElementNS(GML.NAMESPACE, GML.Null.getLocalPart()));
        }

View Full Code Here

TOP

Related Classes of org.opengis.temporal.Period

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.