Package org.opengis.cite.iso19142.util
Class TimeUtils
java.lang.Object
org.opengis.cite.iso19142.util.TimeUtils
Provides various utility methods for working with representations of temporal values.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Document
instantAsGML
(org.opengis.temporal.Instant instant, ZoneOffset offset) Builds a GML representation of a time instant with the specified time-zone offset.static Document
instantAsGMLSubtractOneDay
(org.opengis.temporal.Instant instant, ZoneOffset offset) Builds a GML representation of a time instant with the specified time-zone offset.static Document
intervalAsGML
(ZonedDateTime startDateTime, ZonedDateTime endDateTime) Builds a GML representation of a time interval delimited by the given time instants.static Document
periodAsGML
(org.opengis.temporal.Period period) Builds a GML representation of the given time period.static Document
periodAsGML
(org.opengis.temporal.Period period, ZoneOffset offset) Builds a GML representation of the given time period.static Document
periodAsGMLAddOneDay
(org.opengis.temporal.Period period) Builds a GML representation of the given time period.static Document
periodAsGMLSubtractOneDay
(org.opengis.temporal.Period period) Builds a GML representation of the given time period.
-
Constructor Details
-
TimeUtils
public TimeUtils()
-
-
Method Details
-
intervalAsGML
Builds a GML representation of a time interval delimited by the given time instants. The temporal reference system is ISO 8601 (UTC).- Parameters:
startDateTime
- The starting instant.endDateTime
- The ending instant.- Returns:
- A Document with gml:TimePeriod as the document element, or null if it cannot be created.
-
periodAsGML
Builds a GML representation of the given time period.- Parameters:
period
- A Period representing a temporal interval (UTC).- Returns:
- A Document with gml:TimePeriod as the document element.
-
periodAsGML
Builds a GML representation of the given time period.- Parameters:
period
- A Period representing a temporal interval (UTC).offset
- A time-zone offset from UTC ('Z' if null).- Returns:
- A Document with gml:TimePeriod as the document element.
-
periodAsGMLSubtractOneDay
Builds a GML representation of the given time period.- Parameters:
period
- A Period representing a temporal interval (UTC).- Returns:
- A Document with gml:TimePeriod as the document element. Subtracts one day from beginning and end, see https://github.com/opengeospatial/ets-wfs20/issues/199.
-
periodAsGMLAddOneDay
Builds a GML representation of the given time period.- Parameters:
period
- A Period representing a temporal interval (UTC).- Returns:
- A Document with gml:TimePeriod as the document element. Adds one day to beginning and end, see https://github.com/opengeospatial/ets-wfs20/issues/226.
-
instantAsGML
Builds a GML representation of a time instant with the specified time-zone offset.- Parameters:
instant
- An instant representing a position in time.offset
- A time-zone offset from UTC ('Z' if null).- Returns:
- A Document with gml:TimeInstant as the document element.
-
instantAsGMLSubtractOneDay
public static Document instantAsGMLSubtractOneDay(org.opengis.temporal.Instant instant, ZoneOffset offset) Builds a GML representation of a time instant with the specified time-zone offset.- Parameters:
instant
- An instant representing a position in time.offset
- A time-zone offset from UTC ('Z' if null).- Returns:
- A Document with gml:TimeInstant as the document element. Subtracts one day from the instant, see https://github.com/opengeospatial/ets-wfs20/issues/199.
-