Package org.geotools.referencing.crs
Class DefaultTemporalCRS
- Object
-
- Formattable
-
- AbstractIdentifiedObject
-
- AbstractReferenceSystem
-
- AbstractCRS
-
- AbstractSingleCRS
-
- DefaultTemporalCRS
-
- All Implemented Interfaces:
Serializable
,CoordinateReferenceSystem
,SingleCRS
,TemporalCRS
,IdentifiedObject
,ReferenceSystem
public class DefaultTemporalCRS extends AbstractSingleCRS implements TemporalCRS
A 1D coordinate reference system used for the recording of time.Used with CS type(s) Time
- Since:
- 2.1
- Author:
- Martin Desruisseaux (IRD)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static DefaultTemporalCRS
DUBLIN_JULIAN
Time measured in days since December 31, 1899 at 12:00 UTC.static DefaultTemporalCRS
JAVA
Time measured in milliseconds since January 1st, 1970 at 00:00 UTC.static DefaultTemporalCRS
JULIAN
Time measured in days since January 1st, 4713 BC at 12:00 UTC.static Unit<Time>
MILLISECOND
Unit for milliseconds.static DefaultTemporalCRS
MODIFIED_JULIAN
Time measured in days since November 17, 1858 at 00:00 UTC.static DefaultTemporalCRS
TRUNCATED_JULIAN
Time measured in days since May 24, 1968 at 00:00 UTC.static DefaultTemporalCRS
UNIX
Time measured in seconds since January 1st, 1970 at 00:00 UTC.-
Fields inherited from class AbstractSingleCRS
datum
-
Fields inherited from class AbstractCRS
coordinateSystem
-
Fields inherited from class AbstractIdentifiedObject
EMPTY_ALIAS_ARRAY, EMPTY_IDENTIFIER_ARRAY, IDENTIFIER_COMPARATOR, NAME_COMPARATOR, REMARKS_COMPARATOR
-
Fields inherited from class Formattable
SINGLE_LINE
-
Fields inherited from interface IdentifiedObject
ALIAS_KEY, IDENTIFIERS_KEY, NAME_KEY, REMARKS_KEY
-
Fields inherited from interface ReferenceSystem
DOMAIN_OF_VALIDITY_KEY, SCOPE_KEY
-
-
Constructor Summary
Constructors Constructor Description DefaultTemporalCRS(String name, TemporalDatum datum, TimeCS cs)
Constructs a temporal CRS from a name.DefaultTemporalCRS(Map<String,?> properties, TemporalDatum datum, TimeCS cs)
Constructs a temporal CRS from a set of properties.DefaultTemporalCRS(TemporalCRS crs)
Constructs a new temporal CRS with the same values than the specified one.DefaultTemporalCRS(TemporalDatum datum, TimeCS cs)
Constructs a temporal CRS with the same properties than the given datum.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description TimeCS
getCoordinateSystem()
Returns the coordinate system.TemporalDatum
getDatum()
Returns the datum.int
hashCode()
Returns a hash value for this geographic CRS.Date
toDate(double value)
Convert the given value into aDate
object.double
toValue(Date time)
Convert the given date into a value in this axis unit.static DefaultTemporalCRS
wrap(TemporalCRS crs)
Wraps an arbitrary temporal CRS into a Geotools implementation.-
Methods inherited from class AbstractSingleCRS
equals, getAxis, getDimension
-
Methods inherited from class AbstractCRS
distance, formatWKT
-
Methods inherited from class AbstractReferenceSystem
getDomainOfValidity, getScope
-
Methods inherited from class AbstractIdentifiedObject
asSet, ensureAngularUnit, ensureLinearUnit, ensureNonNull, ensureNonNull, ensureTimeUnit, equals, equals, equals, equals, getAlias, getIdentifier, getIdentifier, getIdentifiers, getName, getName, getName, getProperties, getProperties, getRemarks, nameMatches, nameMatches, nameMatches
-
Methods inherited from class Formattable
cleanupThreadLocals, toString, toWKT, toWKT, toWKT, toWKT
-
Methods inherited from interface IdentifiedObject
getAlias, getIdentifiers, getName, getRemarks, toWKT
-
Methods inherited from interface ReferenceSystem
getDomainOfValidity, getScope
-
-
-
-
Field Detail
-
JULIAN
public static final DefaultTemporalCRS JULIAN
Time measured in days since January 1st, 4713 BC at 12:00 UTC.- Since:
- 2.5
- See Also:
DefaultTemporalDatum.JULIAN
,DefaultTimeCS.DAYS
-
MODIFIED_JULIAN
public static final DefaultTemporalCRS MODIFIED_JULIAN
Time measured in days since November 17, 1858 at 00:00 UTC. A Modified Julian day (MJD) is defined relative to Julian day (JD) asMJD = JD − 2400000.5
.- Since:
- 2.5
- See Also:
DefaultTemporalDatum.MODIFIED_JULIAN
,DefaultTimeCS.DAYS
-
TRUNCATED_JULIAN
public static final DefaultTemporalCRS TRUNCATED_JULIAN
Time measured in days since May 24, 1968 at 00:00 UTC. This epoch was introduced by NASA for the space program. A Truncated Julian day (TJD) is defined relative to Julian day (JD) asTJD = JD − 2440000.5
.- Since:
- 2.5
- See Also:
DefaultTemporalDatum.TRUNCATED_JULIAN
,DefaultTimeCS.DAYS
-
DUBLIN_JULIAN
public static final DefaultTemporalCRS DUBLIN_JULIAN
Time measured in days since December 31, 1899 at 12:00 UTC. A Dublin Julian day (DJD) is defined relative to Julian day (JD) asDJD = JD − 2415020
.- Since:
- 2.5
- See Also:
DefaultTemporalDatum.DUBLIN_JULIAN
,DefaultTimeCS.DAYS
-
UNIX
public static final DefaultTemporalCRS UNIX
Time measured in seconds since January 1st, 1970 at 00:00 UTC.- Since:
- 2.5
- See Also:
DefaultTemporalDatum.UNIX
,DefaultTimeCS.SECONDS
-
JAVA
public static final DefaultTemporalCRS JAVA
Time measured in milliseconds since January 1st, 1970 at 00:00 UTC.- Since:
- 2.5
- See Also:
DefaultTemporalDatum.UNIX
,DefaultTimeCS.MILLISECONDS
-
MILLISECOND
public static final Unit<Time> MILLISECOND
Unit for milliseconds. Useful for conversion from and toDate
objects.
-
-
Constructor Detail
-
DefaultTemporalCRS
public DefaultTemporalCRS(TemporalCRS crs)
Constructs a new temporal CRS with the same values than the specified one. This copy constructor provides a way to wrap an arbitrary implementation into a Geotools one or a user-defined one (as a subclass), usually in order to leverage some implementation-specific API. This constructor performs a shallow copy, i.e. the properties are not cloned.- Parameters:
crs
- The coordinate reference system to copy.- Since:
- 2.2
- See Also:
wrap(org.geotools.api.referencing.crs.TemporalCRS)
-
DefaultTemporalCRS
public DefaultTemporalCRS(TemporalDatum datum, TimeCS cs)
Constructs a temporal CRS with the same properties than the given datum. The inherited properties include the name and aliases.- Parameters:
datum
- The datum.cs
- The coordinate system.- Since:
- 2.5
-
DefaultTemporalCRS
public DefaultTemporalCRS(String name, TemporalDatum datum, TimeCS cs)
Constructs a temporal CRS from a name.- Parameters:
name
- The name.datum
- The datum.cs
- The coordinate system.
-
DefaultTemporalCRS
public DefaultTemporalCRS(Map<String,?> properties, TemporalDatum datum, TimeCS cs)
Constructs a temporal CRS from a set of properties. The properties are given unchanged to the super-class constructor.- Parameters:
properties
- Set of properties. Should contains at least"name"
.cs
- The coordinate system.datum
- The datum.
-
-
Method Detail
-
wrap
public static DefaultTemporalCRS wrap(TemporalCRS crs)
Wraps an arbitrary temporal CRS into a Geotools implementation. This method is usefull if the user wants to take advantage oftoDate(double)
andtoValue(java.util.Date)
methods. If the supplied CRS is already an instance ofDefaultTemporalCRS
or isnull
, then it is returned unchanged.- Parameters:
crs
- The temporal CRS to wrap.- Returns:
- The given CRS as a
DefaultTemporalCRS
.
-
getCoordinateSystem
public TimeCS getCoordinateSystem()
Returns the coordinate system.- Specified by:
getCoordinateSystem
in interfaceCoordinateReferenceSystem
- Specified by:
getCoordinateSystem
in interfaceSingleCRS
- Specified by:
getCoordinateSystem
in interfaceTemporalCRS
- Overrides:
getCoordinateSystem
in classAbstractCRS
- Returns:
- The coordinate system.
-
getDatum
public TemporalDatum getDatum()
Returns the datum.- Specified by:
getDatum
in interfaceSingleCRS
- Specified by:
getDatum
in interfaceTemporalCRS
- Overrides:
getDatum
in classAbstractSingleCRS
- Returns:
- The datum.
-
toDate
public Date toDate(double value)
Convert the given value into aDate
object. This method is the converse oftoValue(java.util.Date)
.- Parameters:
value
- A value in this axis unit.- Returns:
- The value as a date.
-
toValue
public double toValue(Date time)
Convert the given date into a value in this axis unit. This method is the converse oftoDate(double)
.- Parameters:
time
- The value as a date.- Returns:
- value A value in this axis unit.
-
hashCode
public int hashCode()
Returns a hash value for this geographic CRS.- Overrides:
hashCode
in classAbstractSingleCRS
- Returns:
- The hash code value. This value doesn't need to be the same in past or future versions of this class.
-
-