Class DefaultCoordinateMetadata
Object
FormattableObject
DefaultCoordinateMetadata
- All Implemented Interfaces:
Serializable
,LenientComparable
,Printable
public class DefaultCoordinateMetadata
extends FormattableObject
implements LenientComparable, Serializable
Default implementation of metadata required to reference coordinates.
Metadata include a coordinate reference system and the epoch at which the coordinates are valid.
This default implementation provides Well-Known Text support.
It is immutable and serializable if the CRS and epoch are also serializable.
Future evolution
This class is expected to implement aCoordinateMetadata
interface after the next GeoAPI release.- Since:
- 1.5
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new coordinate metadata. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Compares this metadata with the given object for equality.boolean
equals
(Object obj, ComparisonMode mode) Compares this metadata with the given object for equality.protected String
Formats this metadata as a Well Known TextCoordinateMetadata[…]
element.Returns the date at which coordinate tuples referenced to a dynamic CRS are valid.Returns the CRS in which the coordinate tuples are given.int
Returns a hash code value for this coordinate metadata.Methods inherited from class FormattableObject
print, toString, toString, toWKT
-
Constructor Details
-
DefaultCoordinateMetadata
Creates a new coordinate metadata.- Parameters:
crs
- the coordinate reference system (CRS) in which the coordinate tuples are given.epoch
- date at which coordinate tuples are valid, ornull
if the CRS is not dynamic.- Throws:
IllegalArgumentException
- ifepoch
is null while the CRS is dynamic or has a dynamic component.
-
-
Method Details
-
getCoordinateReferenceSystem
Returns the CRS in which the coordinate tuples are given. Should never be null in principle, however this implementation does not enforce this restriction.- Returns:
- the coordinate reference system (CRS) of coordinate tuples.
-
getCoordinateEpoch
-
hashCode
-
equals
Compares this metadata with the given object for equality.- Specified by:
equals
in interfaceLenientComparable
- Overrides:
equals
in classObject
- Parameters:
obj
- the object to compare with this metadata.- Returns:
- whether the two objects are equal.
- See Also:
-
equals
Compares this metadata with the given object for equality.- Specified by:
equals
in interfaceLenientComparable
- Parameters:
obj
- the object to compare tothis
.mode
- the strictness level of the comparison.- Returns:
true
if both objects are equal.- See Also:
-
formatTo
Formats this metadata as a Well Known TextCoordinateMetadata[…]
element.- Specified by:
formatTo
in classFormattableObject
- Parameters:
formatter
- the formatter where to format the inner content of this WKT element.- Returns:
"CoordinateMetadata"
.- See Also:
-