Package org.geotools.temporal.object

Examples of org.geotools.temporal.object.DefaultPeriod


        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


        int[] calendarDate = {1, 1, 1};
        CalendarEra calendarEra = new DefaultCalendarEra(new SimpleInternationalString("Babylonian calendar"),
                new SimpleInternationalString("Ascension of Nebuchadnezzar II to the throne of Babylon"),
                new DefaultCalendarDate(calendar1, null, null, calendarDate),
                new DefaultJulianDate(calendar1, null, 1721423.25),
                new DefaultPeriod(new DefaultInstant(new DefaultPosition(new DefaultJulianDate(calendar1, null, 2087769))),
                new DefaultInstant(new DefaultPosition(new DefaultJulianDate(calendar1, null, 2299160)))));
        Collection<CalendarEra> collection = new ArrayList<CalendarEra>();
        collection.add(calendarEra);
        ((DefaultCalendar) calendar1).setBasis(collection);
        assertFalse(calendar1.getBasis().equals(result));
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
    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 dateFormatter.parse(firstDate);
  }

  private static Period createPeriod(String firstDate, String lastDate) throws ParseException {
   
    return new DefaultPeriod(dateToInstant(firstDate),  dateToInstant(lastDate));
  }
View Full Code Here

  }

  private static Period createPeriod(Date firstDate, Date lastDate) {
        Instant i1 = new DefaultInstant(new DefaultPosition(firstDate));
        Instant i2 = new DefaultInstant(new DefaultPosition(lastDate));
    return new DefaultPeriod(i1, i2);
  }
View Full Code Here

            Literal begin = periodNode.getBeginning();
            Literal end = periodNode.getEnding();
           
        Position ip1 = new DefaultPosition((Date) begin.getValue());
        Position ip2 = new DefaultPosition((Date) end.getValue());
        Period period = new DefaultPeriod(new DefaultInstant(ip1),new DefaultInstant(ip2 ));
           
            return period;
           
        } catch (ClassCastException cce) {
            throw new CQLException("Expecting Period",
View Full Code Here

   
    protected Instant instant(String d) throws ParseException {
        return new DefaultInstant(new DefaultPosition(date(d)));
    }
    protected Period period(String d1, String d2) throws ParseException {
        return new DefaultPeriod(instant(d1), instant(d2));
    }
View Full Code Here

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

    protected Period period(String d1, String d2) throws ParseException {
        return new DefaultPeriod(instant(d1), instant(d2));
    }
View Full Code Here

            //
            // //
          final TemporalObject timeExtent;
          if (startInstant != null){
            if (endInstant != null)
              timeExtent = new DefaultPeriod(startInstant, endInstant);
            else
              timeExtent = startInstant;
            setTimeExtentNode(bb, timeExtent);
          }
          else
View Full Code Here

TOP

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

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.