Object
FormattableObject
AbstractIdentifiedObject
AbstractReferenceSystem
AbstractCRS
DefaultProjectedCRS
- All Implemented Interfaces:
Serializable
,Formattable
,Deprecable
,LenientComparable
,CoordinateReferenceSystem
,GeneralDerivedCRS
,ProjectedCRS
,SingleCRS
,IdentifiedObject
,ReferenceSystem
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
- See Also:
-
Field Summary
Fields inherited from class AbstractIdentifiedObject
DEPRECATED_KEY, LOCALE_KEY
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
ModifierConstructorDescriptionDefaultProjectedCRS
(Map<String, ?> properties, GeographicCRS baseCRS, Conversion conversion, CartesianCS derivedCS) Creates a projected CRS from a defining conversion.protected
Constructs a new coordinate reference system with the same values than the specified one. -
Method Summary
Modifier and TypeMethodDescriptionstatic DefaultProjectedCRS
castOrCopy
(ProjectedCRS object) Returns a SIS coordinate reference system implementation with the same values than the given arbitrary implementation.protected long
Invoked byhashCode()
for computing the hash code when first needed.boolean
equals
(Object object, ComparisonMode mode) Compares this coordinate reference system with the specified object for equality.forConvention
(AxesConvention convention) Returns a coordinate reference system equivalent to this one but with axes rearranged according the given convention.protected String
Formats the inner part of the Well Known Text (WKT) representation of this CRS.Returns the geographic CRS on which the map projection is applied.Returns the map projection from the base CRS to this CRS.final CartesianCS
Returns the coordinate system.Returns the datum of the base CRS.Class
<? extends ProjectedCRS> Returns the GeoAPI interface implemented by this class.Methods inherited from class AbstractCRS
castOrCopy
Methods inherited from class AbstractReferenceSystem
getDomainOfValidity, getScope
Methods inherited from class AbstractIdentifiedObject
castOrCopy, equals, formatTo, getAlias, getDescription, getDomains, getIdentifiers, getName, getRemarks, hashCode, isDeprecated, isHeuristicMatchForName
Methods inherited from class FormattableObject
print, toString, toString, toWKT
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface IdentifiedObject
getAlias, getIdentifiers, getName, getRemarks, toWKT
Methods inherited from interface ReferenceSystem
getDomainOfValidity, getScope
-
Constructor Details
-
DefaultProjectedCRS
public DefaultProjectedCRS(Map<String, ?> properties, GeographicCRS baseCRS, Conversion conversion, CartesianCS derivedCS) throws MismatchedDimensionExceptionCreates 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
orString
AbstractIdentifiedObject.getName()
"alias" GenericName
orCharSequence
(optionally as array)AbstractIdentifiedObject.getAlias()
"identifiers" Identifier
(optionally as array)AbstractIdentifiedObject.getIdentifiers()
"domains" DefaultObjectDomain
(optionally as array)AbstractIdentifiedObject.getDomains()
"remarks" InternationalString
orString
AbstractIdentifiedObject.getRemarks()
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 thebaseToDerived
transform.- Throws:
MismatchedDimensionException
- if the source and target dimensions ofbaseToDerived
do not match the dimensions ofbase
andderivedCS
respectively.- See Also:
-
DefaultProjectedCRS
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:
-
-
Method Details
-
castOrCopy
Returns a SIS coordinate reference system implementation with the same values than the given arbitrary implementation. If the given object isnull
, then this method returnsnull
. 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, ornull
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.
-
getInterface
Returns the GeoAPI interface implemented by this class. The SIS implementation returnsProjectedCRS.class
.Note for implementers
Subclasses usually do not need to override this method since GeoAPI does not defineProjectedCRS
sub-interface. Overriding possibility is left mostly for implementers who wish to extend GeoAPI with their own set of interfaces.- Returns:
ProjectedCRS.class
or a user-defined sub-interface.
-
getDatum
Returns the datum of the base CRS.- Specified by:
getDatum
in interfaceProjectedCRS
- Specified by:
getDatum
in interfaceSingleCRS
- Returns:
- the datum of the base CRS.
-
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 interfaceGeneralDerivedCRS
- Specified by:
getBaseCRS
in interfaceProjectedCRS
- Returns:
- the base coordinate reference system, which must be geographic.
-
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:- The conversion source CRS is the base CRS of
this
CRS. - The conversion target CRS is
this
CRS.
Note: This is different than ISO 19111, which allows source and target CRS to benull
.- Specified by:
getConversionFromBase
in interfaceGeneralDerivedCRS
- Specified by:
getConversionFromBase
in interfaceProjectedCRS
- Returns:
- the map projection from base CRS to this CRS.
- The conversion source CRS is the base CRS of
-
getCoordinateSystem
Returns the coordinate system.- Specified by:
getCoordinateSystem
in interfaceCoordinateReferenceSystem
- Specified by:
getCoordinateSystem
in interfaceProjectedCRS
- Specified by:
getCoordinateSystem
in interfaceSingleCRS
- Overrides:
getCoordinateSystem
in classAbstractCRS
- Returns:
- the coordinate system.
-
forConvention
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 returnsthis
.- Overrides:
forConvention
in classAbstractCRS
- 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:
-
equals
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 givenComparisonMode
isIGNORE_METADATA
orAPPROXIMATE
, then axis order of the base geographic CRS are ignored (but not axis order of this projected CRS).- Specified by:
equals
in interfaceLenientComparable
- Parameters:
object
- the object to compare tothis
.mode
-STRICT
for performing a strict comparison, orIGNORE_METADATA
for comparing only properties relevant to coordinate transformations.- Returns:
true
if both objects are equal.- See Also:
-
computeHashCode
protected long computeHashCode()Invoked byhashCode()
for computing the hash code when first needed. SeeAbstractIdentifiedObject.computeHashCode()
for more information.- Returns:
- the hash code value. This value may change in any future Apache SIS version.
-
formatTo
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.ProjectedCRS[“NTF (Paris) / Lambert zone II”, BaseGeodCRS[“NTF (Paris)”, Datum[“Nouvelle Triangulation Francaise”, Ellipsoid[“NTF”, 6378249.2, 293.4660212936269, LengthUnit[“metre”, 1]]], PrimeMeridian[“Paris”, 2.5969213, AngleUnit[“grad”, 0.015707963267948967]]], Conversion[“Lambert zone II”, Method[“Lambert Conic Conformal (1SP)”, Id[“EPSG”, 9801, Citation[“IOGP”]]], Parameter[“Latitude of natural origin”, 52.0, AngleUnit[“grad”, 0.015707963267948967], Id[“EPSG”, 8801]], Parameter[“Longitude of natural origin”, 0.0, AngleUnit[“degree”, 0.017453292519943295], Id[“EPSG”, 8802]], Parameter[“Scale factor at natural origin”, 0.99987742, ScaleUnit[“unity”, 1], Id[“EPSG”, 8805]], Parameter[“False easting”, 600000.0, LengthUnit[“metre”, 1], Id[“EPSG”, 8806]], Parameter[“False northing”, 2200000.0, LengthUnit[“metre”, 1], Id[“EPSG”, 8807]]], CS[“Cartesian”, 2], Axis[“Easting (E)”, east, Order[1]], Axis[“Northing (N)”, north, Order[2]], LengthUnit[“metre”, 1], Id[“EPSG”, 27572, Citation[“IOGP”], URI[“urn:ogc:def:crs:EPSG::27572”]]]
Same coordinate reference system using WKT 1.
PROJCS[“NTF (Paris) / Lambert zone II”, GEOGCS[“NTF (Paris)”, DATUM[“Nouvelle Triangulation Francaise”, SPHEROID[“NTF”, 6378249.2, 293.4660212936269]], PRIMEM[“Paris”, 2.33722917], UNIT[“degree”, 0.017453292519943295], AXIS[“Longitude”, EAST], AXIS[“Latitude”, NORTH]], PROJECTION[“Lambert_Conformal_Conic_1SP”, AUTHORITY[“EPSG”, “9801”]], PARAMETER[“latitude_of_origin”, 46.8], PARAMETER[“central_meridian”, 0.0], PARAMETER[“scale_factor”, 0.99987742], PARAMETER[“false_easting”, 600000.0], PARAMETER[“false_northing”, 2200000.0], UNIT[“metre”, 1], AXIS[“Easting”, EAST], AXIS[“Northing”, NORTH], AUTHORITY[“EPSG”, “27572”]]
- Overrides:
formatTo
in classAbstractCRS
- Parameters:
formatter
- the formatter where to format the inner content of this WKT element.- Returns:
"ProjectedCRS"
(WKT 2) or"ProjCS"
(WKT 1).- See Also:
-