Class AbstractCRS

    • Field Detail

      • coordinateSystem

        protected final CoordinateSystem coordinateSystem
        The coordinate system.
    • Constructor Detail

      • AbstractCRS

        public AbstractCRS​(CoordinateReferenceSystem crs)
        Constructs a new coordinate reference system 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.
        crs - The coordinate reference system to copy.
      • AbstractCRS

        public AbstractCRS​(Map<String,​?> properties,
                           CoordinateSystem cs)
        Constructs a coordinate reference system from a set of properties. The properties are given unchanged to the super-class constructor.
        properties - Set of properties. Should contains at least "name".
        cs - The coordinate system.
    • Method Detail

      • distance

        public Measure distance​(double[] coord1,
                                double[] coord2)
                         throws UnsupportedOperationException,
        Computes the distance between two points. This convenience method delegates the work to the underlyling coordinate system, if possible.
        coord1 - Coordinates of the first point.
        coord2 - Coordinates of the second point.
        The distance between coord1 and coord2.
        UnsupportedOperationException - if this coordinate reference system can't compute distances.
        MismatchedDimensionException - if a coordinate doesn't have the expected dimension.
      • equals

        public boolean equals​(AbstractIdentifiedObject object,
                              boolean compareMetadata)
        Compare this coordinate reference system with the specified object for equality. If compareMetadata is true, then all available properties are compared including AbstractReferenceSystem.getDomainOfValidity() valid area} and scope.
        equals in class AbstractReferenceSystem
        object - The object to compare to this.
        compareMetadata - true for performing a strict comparaison, or false for comparing only properties relevant to transformations.
        true if both objects are equal.
      • hashCode

        public int hashCode()
        Returns a hash value for this CRS. Name, identifiers and remarks are not taken in account. In other words, two CRS objects will return the same hash value if they are equal in the sense of equals(AbstractIdentifiedObject, false).
        hashCode in class AbstractIdentifiedObject
        The hash code value. This value doesn't need to be the same in past or future versions of this class.