Package org.geotools.temporal.object

Examples of org.geotools.temporal.object.DefaultJulianDate


        Collection<CalendarEra> result = calendar1.getBasis();
        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


        TemporalReferenceSystem frame2 = new DefaultTemporalReferenceSystem(name2, null);
        int[] calendarDate1 = {1900, 1, 1};
        int[] calendarDate2 = {400, 1, 1};
        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()));
View Full Code Here

     * Test of setJulianReference method, of class DefaultCalendarEra.
     */
    @Test
    public void testSetJulianReference() {
        JulianDate result = calendarEra1.getJulianReference();
        ((DefaultCalendarEra)calendarEra1).setJulianReference(new DefaultJulianDate(null, null, 785410));
        assertFalse(calendarEra1.getJulianReference().equals(result));
    }
View Full Code Here

                    // change over to Gregorian calendar
                    int ja = (int) (0.01 * julianYear);
                    julian += 2 - ja + (0.25 * ja);
                }
                coordinateValue = java.lang.Math.floor(julian);
                response = new DefaultJulianDate(refSystem, null, coordinateValue);
                return response;
            }
        } else if (time != null) {
            Number[] clk = time.getClockTime();
            Number hour = 0;
            Number minute = 0;
            Number second = 0;
            if (clk.length > 3) {
                throw new IllegalArgumentException("The ClockTime Number array is malformed ! see ISO 8601 format.");
            } else {
                hour = clk[0];
                if (clk.length > 0) {
                    minute = clk[1];
                }
                if (clk.length > 1) {
                    second = clk[2];
                }
                double julian = ((hour.doubleValue() - 12) / 24) + (minute.doubleValue() / 1440) + (second.doubleValue() / 86400);
                coordinateValue = julian;
                response = new DefaultJulianDate(refSystem, null, coordinateValue);
                return response;
            }
        } else {
            throw new IllegalArgumentException("the both CalendarDate and ClockTime cannot be null !");
        }
View Full Code Here

                }
                double julian = ((hour.doubleValue() - 12) / 24) + (minute.doubleValue() / 1440) + (second.doubleValue() / 86400);
                coordinateValue = coordinateValue.doubleValue() + julian;
            }
        }
        response = new DefaultJulianDate(refSystem, null, coordinateValue);
        return response;
    }
View Full Code Here

TOP

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

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.