Class DefaultCoordinateMetadata

Object
FormattableObject
DefaultCoordinateMetadata
All Implemented Interfaces:
Serializable, Lenient­Comparable, 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 a Coordinate­Metadata interface after the next GeoAPI release.
Since:
1.5
See Also:
  • Constructor Details

    • DefaultCoordinateMetadata

      public DefaultCoordinateMetadata(CoordinateReferenceSystem crs, Temporal epoch)
      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, or null if the CRS is not dynamic.
      Throws:
      Illegal­Argument­Exception - if epoch is null while the CRS is dynamic or has a dynamic component.
  • Method Details

    • getCoordinateReferenceSystem

      public CoordinateReferenceSystem 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

      public Optional<Temporal> getCoordinateEpoch()
      Returns the date at which coordinate tuples referenced to a dynamic CRS are valid.
      Returns:
      epoch at which coordinate tuples are valid.
    • hashCode

      public int hashCode()
      Returns a hash code value for this coordinate metadata.
      Overrides:
      hash­Code in class Object
      Returns:
      a hash code value.
    • equals

      public final boolean equals(Object obj)
      Compares this metadata with the given object for equality.
      Specified by:
      equals in interface Lenient­Comparable
      Overrides:
      equals in class Object
      Parameters:
      obj - the object to compare with this metadata.
      Returns:
      whether the two objects are equal.
      See Also:
    • equals

      public boolean equals(Object obj, ComparisonMode mode)
      Compares this metadata with the given object for equality.
      Specified by:
      equals in interface Lenient­Comparable
      Parameters:
      obj - the object to compare to this.
      mode - the strictness level of the comparison.
      Returns:
      true if both objects are equal.
      See Also:
    • formatTo

      protected String formatTo(Formatter formatter)
      Formats this metadata as a Well Known Text Coordinate­Metadata[…] element.
      Specified by:
      format­To in class Formattable­Object
      Parameters:
      formatter - the formatter where to format the inner content of this WKT element.
      Returns:
      "Coordinate­Metadata".
      See Also: