Package org.opengis.temporal

Examples of org.opengis.temporal.Period


        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

        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()));

        Period epochOfUse1 = new DefaultPeriod(begining1, ending1);
        Period epochOfUse2 = new DefaultPeriod(begining2, ending2);

        calendarEra1 = new DefaultCalendarEra(new SimpleInternationalString("Cenozoic"),
                new SimpleInternationalString("no description"),
                referenceDate1, julianReference, epochOfUse1);
        calendarEra2 = new DefaultCalendarEra(new SimpleInternationalString("Mesozoic"),
View Full Code Here

    /**
     * Test of getEpochOfUse method, of class DefaultCalendarEra.
     */
    @Test
    public void testGetEpochOfUse() {
        Period result = calendarEra1.getEpochOfUse();
        assertFalse(calendarEra2.getEpochOfUse().equals(result));
    }
View Full Code Here

   
   
    public During buildDuringPeriod() throws CQLException {
       
        // retrieves date and duration from expression
    Period period = this.resultStack.popPeriod();

        Expression property = this.resultStack.popExpression();

        During filter = this.filterFactory.during(property, this.filterFactory.literal(period));
View Full Code Here

    /**
     * Test of setEpochOfUse method, of class DefaultCalendarEra.
     */
    @Test
    public void testSetEpochOfUse() {
        Period result = calendarEra1.getEpochOfUse();
        cal.set(1900, 10, 10);
        ((DefaultCalendarEra)calendarEra1).setEpochOfUse(new DefaultPeriod(new DefaultInstant(new DefaultPosition(cal.getTime())), new DefaultInstant(new DefaultPosition(new Date()))));
        assertFalse(calendarEra1.getEpochOfUse().equals(result));
    }
View Full Code Here

     * @return Or filter
     * @throws CQLException
     */
    public Or buildDuringOrAfter() throws CQLException{

        Period period = this.resultStack.popPeriod();
       
        PropertyName property = this.resultStack.popPropertyName();

        // makes the after filter
        After right = this.filterFactory.after(property, filterFactory.literal(period.getEnding()));
       
        // makes the during filter
        During left = this.filterFactory.during(property, this.filterFactory.literal(period));

      Or filter = this.filterFactory.or(left, right);
View Full Code Here

     * @return Or filter
     * @throws CQLException
     */
    public Or buildBeforeOrDuring() throws CQLException{

        Period period = this.resultStack.popPeriod();
       
        PropertyName property = this.resultStack.popPropertyName();

        // makes the after filter
        Before right = this.filterFactory.before(property, filterFactory.literal(period.getBeginning()));
       
        // makes the during filter
        During left = this.filterFactory.during(property, this.filterFactory.literal(period));
       
        Or filter = this.filterFactory.or(right, left);
View Full Code Here

        final PropertyName property,
        final Date firstDate,
        final Date lastDate) {
      Before before = FACTORY.before(property, FACTORY.literal(firstDate));
     
      Period period = createPeriod(firstDate, lastDate);
      During during  = FACTORY.during(property, FACTORY.literal(period));
      Or filter = FACTORY.or(before, during  );
      return filter;
  }
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.