Class DefaultProjectedCRS

All Implemented Interfaces:
Serializable, Formattable, Deprecable, LenientComparable, org.opengis.referencing.crs.CoordinateReferenceSystem, org.opengis.referencing.crs.GeneralDerivedCRS, org.opengis.referencing.crs.ProjectedCRS, org.opengis.referencing.crs.SingleCRS, org.opengis.referencing.IdentifiedObject, org.opengis.referencing.ReferenceSystem

public class DefaultProjectedCRS extends AbstractDerivedCRS<org.opengis.referencing.operation.Projection> implements org.opengis.referencing.crs.ProjectedCRS
A 2-dimensional coordinate reference system used to approximate the shape of the earth on a planar surface. It is done in such a way that the distortion that is inherent to the approximation is carefully controlled and known. Distortion correction is commonly applied to calculated bearings and distances to produce values that are a close match to actual field values.

Used with datum type: Geodetic.
Used with coordinate system type: Cartesian.

Immutability and thread safety

This class is immutable and thus thread-safe if the property values (not necessarily the map itself), the coordinate system and the datum instances given to the constructor are also immutable. Unless otherwise noted in the javadoc, this condition holds if all components were created using only SIS factories and static constants.
Since:
0.6
Version:
0.6
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Serial number for inter-operability with different versions.
      See Also:
  • Constructor Details

    • DefaultProjectedCRS

      public DefaultProjectedCRS(Map<String,?> properties, org.opengis.referencing.crs.GeographicCRS baseCRS, org.opengis.referencing.operation.Conversion conversion, org.opengis.referencing.cs.CartesianCS derivedCS) throws org.opengis.geometry.MismatchedDimensionException
      Creates a projected CRS from a defining conversion. The properties given in argument follow the same rules than for the super-class constructor. The following table is a reminder of main (not all) properties:
      Recognized properties (non exhaustive list)
      Property name Value type Returned by
      "name" Identifier or String AbstractIdentifiedObject.getName()
      "alias" GenericName or CharSequence (optionally as array) AbstractIdentifiedObject.getAlias()
      "identifiers" Identifier (optionally as array) AbstractIdentifiedObject.getIdentifiers()
      "remarks" InternationalString or String AbstractIdentifiedObject.getRemarks()
      "domainOfValidity" Extent AbstractReferenceSystem.getDomainOfValidity()
      "scope" InternationalString or String AbstractReferenceSystem.getScope()
      The supplied conversion argument shall not includes the operation steps for performing unit conversions and change of axis order since those operations will be inferred by this constructor.
      Parameters:
      properties - the properties to be given to the new derived CRS object.
      baseCRS - coordinate reference system to base the derived CRS on.
      conversion - the defining conversion from a normalized base to a normalized derived CRS.
      derivedCS - the coordinate system for the derived CRS. The number of axes must match the target dimension of the baseToDerived transform.
      Throws:
      org.opengis.geometry.MismatchedDimensionException - if the source and target dimensions of baseToDerived do not match the dimensions of base and derivedCS respectively.
      See Also:
    • DefaultProjectedCRS

      protected DefaultProjectedCRS(org.opengis.referencing.crs.ProjectedCRS crs)
      Constructs a new coordinate reference system with the same values than the specified one. This copy constructor provides a way to convert an arbitrary implementation into a SIS 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.
      See Also:
    • DefaultProjectedCRS

      private DefaultProjectedCRS()
      Constructs a new object in which every attributes are set to a default value. This is not a valid object. This constructor is strictly reserved to JAXB, which will assign values to the fields using reflection.
  • Method Details

    • castOrCopy

      public static DefaultProjectedCRS castOrCopy(org.opengis.referencing.crs.ProjectedCRS object)
      Returns a SIS coordinate reference system implementation with the same values than the given arbitrary implementation. If the given object is null, then this method returns null. Otherwise if the given object is already a SIS implementation, then the given object is returned unchanged. Otherwise a new SIS implementation is created and initialized to the attribute values of the given object.
      Parameters:
      object - the object to get as a SIS implementation, or null if none.
      Returns:
      a SIS implementation containing the values of the given object (may be the given object itself), or null if the argument was null.
    • getConversionType

      final Class<org.opengis.referencing.operation.Projection> getConversionType()
      Returns the type of conversion associated to this DefaultProjectedCRS. Must be a hard-coded, constant value (not dependent on object state).
      Specified by:
      getConversionType in class AbstractDerivedCRS<org.opengis.referencing.operation.Projection>
    • getInterface

      public Class<? extends org.opengis.referencing.crs.ProjectedCRS> getInterface()
      Returns the GeoAPI interface implemented by this class. The SIS implementation returns ProjectedCRS.class.
      Note for implementers: Subclasses usually do not need to override this method since GeoAPI does not define ProjectedCRS sub-interface. Overriding possibility is left mostly for implementers who wish to extend GeoAPI with their own set of interfaces.
      Specified by:
      getInterface in class AbstractDerivedCRS<org.opengis.referencing.operation.Projection>
      Returns:
      ProjectedCRS.class or a user-defined sub-interface.
    • getDatum

      public org.opengis.referencing.datum.GeodeticDatum getDatum()
      Returns the datum of the base CRS.
      Specified by:
      getDatum in interface org.opengis.referencing.crs.ProjectedCRS
      Specified by:
      getDatum in interface org.opengis.referencing.crs.SingleCRS
      Specified by:
      getDatum in class AbstractDerivedCRS<org.opengis.referencing.operation.Projection>
      Returns:
      the datum of the base CRS.
    • getBaseCRS

      public org.opengis.referencing.crs.GeographicCRS getBaseCRS()
      Returns the geographic CRS on which the map projection is applied. This CRS defines the datum of this CRS and (at least implicitly) the source of the conversion from base.
      Specified by:
      getBaseCRS in interface org.opengis.referencing.crs.GeneralDerivedCRS
      Specified by:
      getBaseCRS in interface org.opengis.referencing.crs.ProjectedCRS
      Returns:
      the base coordinate reference system, which must be geographic.
    • getConversionFromBase

      public org.opengis.referencing.operation.Projection getConversionFromBase()
      Returns the map projection from the base CRS to this CRS. In Apache SIS, the conversion source and target CRS are set to the following values:
      Note: This is different than ISO 19111, which allows source and target CRS to be null.
      Specified by:
      getConversionFromBase in interface org.opengis.referencing.crs.GeneralDerivedCRS
      Specified by:
      getConversionFromBase in interface org.opengis.referencing.crs.ProjectedCRS
      Overrides:
      getConversionFromBase in class AbstractDerivedCRS<org.opengis.referencing.operation.Projection>
      Returns:
      the map projection from base CRS to this CRS.
    • getCoordinateSystem

      public final org.opengis.referencing.cs.CartesianCS getCoordinateSystem()
      Returns the coordinate system.
      Specified by:
      getCoordinateSystem in interface org.opengis.referencing.crs.CoordinateReferenceSystem
      Specified by:
      getCoordinateSystem in interface org.opengis.referencing.crs.ProjectedCRS
      Specified by:
      getCoordinateSystem in interface org.opengis.referencing.crs.SingleCRS
      Overrides:
      getCoordinateSystem in class AbstractCRS
      Returns:
      the coordinate system.
    • forConvention

      public DefaultProjectedCRS forConvention(AxesConvention convention)
      Returns a coordinate reference system equivalent to this one but with axes rearranged according the given convention. If this CRS is already compatible with the given convention, then this method returns this.
      Overrides:
      forConvention in class AbstractCRS
      Parameters:
      convention - the axes convention for which a coordinate reference system is desired.
      Returns:
      a coordinate reference system compatible with the given convention (may be this).
      See Also:
    • createSameType

      final AbstractCRS createSameType(Map<String,?> properties, org.opengis.referencing.cs.CoordinateSystem cs)
      Returns a coordinate reference system of the same type than this CRS but with different axes.
      Overrides:
      createSameType in class AbstractCRS
    • equals

      public boolean equals(Object object, ComparisonMode mode)
      Compares this coordinate reference system with the specified object for equality. In addition to the metadata documented in the parent class, this method considers coordinate system axes of the base CRS as metadata. This means that if the given ComparisonMode is IGNORE_METADATA or APPROXIMATE, then axis order of the base geographic CRS are ignored (but not axis order of this projected CRS).
      Specified by:
      equals in interface LenientComparable
      Overrides:
      equals in class AbstractDerivedCRS<org.opengis.referencing.operation.Projection>
      Parameters:
      object - the object to compare to this.
      mode - STRICT for performing a strict comparison, or IGNORE_METADATA for comparing only properties relevant to coordinate transformations.
      Returns:
      true if both objects are equal.
      See Also:
    • computeHashCode

      protected long computeHashCode()
      Invoked by hashCode() for computing the hash code when first needed. See AbstractIdentifiedObject.computeHashCode() for more information.
      Overrides:
      computeHashCode in class AbstractDerivedCRS<org.opengis.referencing.operation.Projection>
      Returns:
      the hash code value. This value may change in any future Apache SIS version.
    • formatTo

      protected String formatTo(Formatter formatter)
      Formats the inner part of the Well Known Text (WKT) representation of this CRS.
      Example: Well-Known Text (version 2) of a projected coordinate reference system using the Lambert Conformal method.

      Same coordinate reference system using WKT 1.

      Overrides:
      formatTo in class AbstractCRS
      Parameters:
      formatter - the formatter where to format the inner content of this WKT element.
      Returns:
      "ProjectedCRS" (WKT 2) or "ProjCS" (WKT 1).
      See Also:
    • setBaseCRS

      private void setBaseCRS(org.opengis.referencing.crs.GeographicCRS crs)
      Used by JAXB only (invoked by reflection).
      See Also:
    • setCoordinateSystem

      private void setCoordinateSystem(org.opengis.referencing.cs.CartesianCS cs)
      Used by JAXB only (invoked by reflection).
      See Also: