GeoAPI provides a set of interfaces in programming languages (currently Java and Python) for geospatial applications. The GeoAPI interfaces closely follow OGC specifications, adaptated to match the expectations of programmers.
Replace usage of java.util.Date (a legacy class from Java 1) by usage of java.time (new package introduced in Java 8). There is two main types of interest:
Instant for a point on the time axis, regardless its representation in any calendar system. It is measured as the number of seconds since an epoch.
Temporal as the abstract type for a number of specialized subtypes: LocalDate, LocalTime, LocalDateTime, OffsetDateTime (i.e. date and time with a time zone), OffsetTime, Year, YearMonth, and more (Japanese dates, Minguo dates, etc.).
Instant is relevant to ISO 19111 (referencing by coordinates), while Temporal is good for ISO 19115 (metadata) because it allows users to specify the dates with different degrees of precision (with or without time, with or without timezone, etc.).
Replace usage of
java.util.Date
(a legacy class from Java 1) by usage ofjava.time
(new package introduced in Java 8). There is two main types of interest:Instant
for a point on the time axis, regardless its representation in any calendar system. It is measured as the number of seconds since an epoch.Temporal
as the abstract type for a number of specialized subtypes:LocalDate
,LocalTime
,LocalDateTime
,OffsetDateTime
(i.e. date and time with a time zone),OffsetTime
,Year
,YearMonth
, and more (Japanese dates, Minguo dates, etc.).Instant
is relevant to ISO 19111 (referencing by coordinates), whileTemporal
is good for ISO 19115 (metadata) because it allows users to specify the dates with different degrees of precision (with or without time, with or without timezone, etc.).