Package org.geotools.temporal.object

Examples of org.geotools.temporal.object.DefaultInstant


                        try {
                            epoch = (Date) NetCDFUtilities.getAxisFormat(type, origin).parseObject(origin);
                            GregorianCalendar cal = new GregorianCalendar();
                            cal.setTime(epoch);
                            DefaultInstant instant = new DefaultInstant(new DefaultPosition(cal.getTime()));
                            t_originDate = instant.getPosition().getDateTime().toString();
                        } catch (ParseException e) {
                            throw new IllegalArgumentException(e);
                            // TODO: Change the handle this exception
                        }
                    }
View Full Code Here


        String frameName = (String) node.getAttributeValue("frame", "#ISO-8601");
        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 = Wcs10Factory.eINSTANCE.createTimePeriodType();
                    TimePositionType beginPosition = Gml4wcsFactory.eINSTANCE.createTimePositionType();
                    TimePositionType endPosition = Gml4wcsFactory.eINSTANCE.createTimePositionType();
                   
                    beginPosition.setValue(begining.getPosition().getDate());
                    endPosition.setValue(ending.getPosition().getDate());
                   
                    timePeriod.setBeginPosition(beginPosition);
                    timePeriod.setEndPosition(endPosition);

                    results.getTimePeriod().add(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

        CalendarDate referenceDate1 = new DefaultCalendarDate(frame1, IndeterminateValue.BEFORE, new SimpleInternationalString("Gregorian calendar"), calendarDate1);
        CalendarDate referenceDate2 = new DefaultCalendarDate(frame2, IndeterminateValue.NOW, new SimpleInternationalString("Babylonian calendar"), calendarDate2);
        JulianDate julianReference = new DefaultJulianDate(frame1, IndeterminateValue.NOW, 123456789);
       
        cal.set(1900, 0, 1);
        Instant begining1 = new DefaultInstant(new DefaultPosition(cal.getTime()));
        cal.set(2000, 9, 17);
        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()));

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

        calendarEra1 = new DefaultCalendarEra(new SimpleInternationalString("Cenozoic"),
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 new DefaultPeriod(dateToInstant(firstDate),  dateToInstant(lastDate));
  }

  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

    } catch (ParseException e) {
      e.printStackTrace();
      throw e;
    }

        Instant instant = new DefaultInstant(new DefaultPosition(date));

        return instant;
    }
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 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

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.