Package org.apache.sis.referencing.crs
Class DefaultDerivedCRS
Object
FormattableObject
AbstractIdentifiedObject
AbstractReferenceSystem
AbstractCRS
DefaultDerivedCRS
- All Implemented Interfaces:
- Serializable,- Formattable,- Deprecable,- LenientComparable,- CoordinateReferenceSystem,- DerivedCRS,- GeneralDerivedCRS,- SingleCRS,- IdentifiedObject,- ReferenceSystem
A coordinate reference system that is defined by its coordinate conversion
 from another CRS (not by a datum). 
   
 Those specialized subclasses can be inferred automatically by the 
DerivedCRS
 cannot be projected CRS themselves, but may be derived from a projected CRS
 (for example in order to use a polar coordinate system).
 A DerivedCRS instance may also implement one of the interfaces listed below,
 provided that the conditions in the right column are met (derived from ISO 19162):
| Type | Conditions | 
|---|---|
| GeodeticCRS | Base CRS is also a GeodeticCRSand is associated to the same type of coordinate system. | 
| VerticalCRS | Base CRS is also a VerticalCRSand coordinate system is aVerticalCS. | 
| TemporalCRS | Base CRS is also a TemporalCRSand coordinate system is aTimeCS. | 
| ParametricCRS | Base CRS is also a ParametricCRSand coordinate system is aParametricCS. | 
| EngineeringCRS | Base CRS is a GeodeticCRS,ProjectedCRSorEngineeringCRS. | 
create(…) static method.
 Alternatively, users can create their own DefaultDerivedCRS subclass implementing the desired interface.
 Immutability and thread safety
This base class is immutable and thus thread-safe if the property values (not necessarily the map itself) given to the constructor are also immutable. Most SIS subclasses and related classes are immutable under similar conditions. This means that unless otherwise noted in the javadoc,GeneralDerivedCRS instances created
 using only SIS factories and static constants can be shared by many objects and passed between threads without
 synchronization.- Since:
- 0.6
- See Also:
Defined in the sis-referencing module
- 
Field SummaryFields inherited from class AbstractIdentifiedObjectDEPRECATED_KEY, LOCALE_KEYFields inherited from interface IdentifiedObjectALIAS_KEY, IDENTIFIERS_KEY, NAME_KEY, REMARKS_KEYFields inherited from interface ReferenceSystemDOMAIN_OF_VALIDITY_KEY, SCOPE_KEY
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedDefaultDerivedCRS(Map<String, ?> properties, SingleCRS baseCRS, CoordinateReferenceSystem interpolationCRS, OperationMethod method, MathTransform baseToDerived, CoordinateSystem derivedCS) Creates a derived CRS from a math transform.protectedDefaultDerivedCRS(Map<String, ?> properties, SingleCRS baseCRS, Conversion conversion, CoordinateSystem derivedCS) Creates a derived CRS from a defining conversion.protectedConstructs a new coordinate reference system with the same values than the specified one.
- 
Method SummaryModifier and TypeMethodDescriptionstatic DefaultDerivedCRScastOrCopy(DerivedCRS object) Returns a SIS coordinate reference system implementation with the same values than the given arbitrary implementation.protected longInvoked byhashCode()for computing the hash code when first needed.static DefaultDerivedCRScreate(Map<String, ?> properties, SingleCRS baseCRS, CoordinateReferenceSystem interpolationCRS, OperationMethod method, MathTransform baseToDerived, CoordinateSystem derivedCS) Creates a derived CRS from a math transform and a type inferred from the given arguments.static DefaultDerivedCRScreate(Map<String, ?> properties, SingleCRS baseCRS, Conversion conversion, CoordinateSystem derivedCS) Creates a derived CRS from a defining conversion and a type inferred from the given arguments.booleanequals(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 StringFormats the inner part of the Well Known Text (WKT) representation of this CRS.Returns the CRS on which the conversion is applied.Returns the conversion from the base CRS to this CRS.Returns the coordinate system.Returns the datum of the base CRS.Class<? extends DerivedCRS>Returns the GeoAPI interface implemented by this class.Methods inherited from class AbstractCRScastOrCopyMethods inherited from class AbstractReferenceSystemgetDomainOfValidity, getScopeMethods inherited from class AbstractIdentifiedObjectcastOrCopy, equals, formatTo, getAlias, getDescription, getIdentifiers, getName, getRemarks, hashCode, isDeprecated, isHeuristicMatchForNameMethods inherited from class FormattableObjectprint, toString, toString, toWKTMethods inherited from class Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface IdentifiedObjectgetAlias, getIdentifiers, getName, getRemarks, toWKTMethods inherited from interface ReferenceSystemgetDomainOfValidity, getScope
- 
Constructor Details- 
DefaultDerivedCRSprotected DefaultDerivedCRS(Map<String, ?> properties, SingleCRS baseCRS, Conversion conversion, CoordinateSystem derivedCS) throws MismatchedDimensionExceptionCreates a derived 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:
 The suppliedRecognized properties (non exhaustive list) Property name Value type Returned by "name" IdentifierorStringAbstractIdentifiedObject.getName()"alias" GenericNameorCharSequence(optionally as array)AbstractIdentifiedObject.getAlias()"identifiers" Identifier(optionally as array)AbstractIdentifiedObject.getIdentifiers()"remarks" InternationalStringorStringAbstractIdentifiedObject.getRemarks()"domainOfValidity" ExtentAbstractReferenceSystem.getDomainOfValidity()"scope" InternationalStringorStringAbstractReferenceSystem.getScope()conversionargument 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- baseToDerivedtransform.
- Throws:
- MismatchedDimensionException- if the source and target dimensions of- baseToDeriveddo not match the dimensions of- baseand- derivedCSrespectively.
- See Also:
 
- 
DefaultDerivedCRSprotected DefaultDerivedCRS(Map<String, ?> properties, SingleCRS baseCRS, CoordinateReferenceSystem interpolationCRS, OperationMethod method, MathTransform baseToDerived, CoordinateSystem derivedCS) Creates a derived CRS from a math transform. The givenMathTransformshall transform coordinate values specifically from thebaseCRStothisCRS (optionally with an interpolation CRS); there is no consideration about “normalized CRS” in this constructor.Conversion propertiesThepropertiesmap given in argument can contain any entries documented in the above constructor, together with any entries documented by the conversion constructor provided that theConversionentry keys are prefixed by"conversion.". In particular, the two first properties listed below are mandatory:Mandatory properties and some optional properties Property name Value type Returned by "name" IdentifierorStringthis.getName()"conversion.name" IdentifierorStringconversionFromBase.getName()Optional properties (non exhaustive list) "identifiers" Identifier(optionally as array)this.getIdentifiers()"domainOfValidity" ExtentconversionFromBase.getDomainOfValidity()- Parameters:
- properties- the properties to be given to the- DefaultConversionobject (with keys prefixed by- "conversion.") and to the new derived CRS object.
- baseCRS- coordinate reference system to base the derived CRS on.
- interpolationCRS- the CRS of additional coordinates needed for the operation, or- nullif none.
- method- the coordinate operation method (mandatory in all cases).
- baseToDerived- transform from positions in the base CRS to positions in this target CRS.
- derivedCS- the coordinate system for the derived CRS.
- Throws:
- IllegalArgumentException- if at least one argument has an incompatible number of dimensions.
- See Also:
 
- 
DefaultDerivedCRSConstructs 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- 
createpublic static DefaultDerivedCRS create(Map<String, ?> properties, SingleCRS baseCRS, Conversion conversion, CoordinateSystem derivedCS) throws MismatchedDimensionExceptionCreates a derived CRS from a defining conversion and a type inferred from the given arguments. This method expects the same arguments and performs the same work than the above constructor, except that theDerivedCRSinstance returned by this method may additionally implement theGeodeticCRS,VerticalCRS,TemporalCRS,ParametricCRSorEngineeringCRSinterface. See the class javadoc for more information.- 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- baseToDerivedtransform.
- Returns:
- the newly created derived CRS, potentially implementing an additional CRS interface.
- Throws:
- MismatchedDimensionException- if the source and target dimensions of- baseToDeriveddo not match the dimensions of- baseand- derivedCSrespectively.
- See Also:
 
- 
createpublic static DefaultDerivedCRS create(Map<String, ?> properties, SingleCRS baseCRS, CoordinateReferenceSystem interpolationCRS, OperationMethod method, MathTransform baseToDerived, CoordinateSystem derivedCS) Creates a derived CRS from a math transform and a type inferred from the given arguments. This method expects the same arguments and performs the same work than the above constructor, except that theDerivedCRSinstance returned by this method may additionally implement theGeodeticCRS,VerticalCRS,TemporalCRS,ParametricCRSorEngineeringCRSinterface. See the class javadoc for more information.- Parameters:
- properties- the properties to be given to the- DefaultConversionobject (with keys prefixed by- "conversion.") and to the new derived CRS object.
- baseCRS- coordinate reference system to base the derived CRS on.
- interpolationCRS- the CRS of additional coordinates needed for the operation, or- nullif none.
- method- the coordinate operation method (mandatory in all cases).
- baseToDerived- transform from positions in the base CRS to positions in this target CRS.
- derivedCS- the coordinate system for the derived CRS.
- Returns:
- the newly created derived CRS, potentially implementing an additional CRS interface.
- Throws:
- IllegalArgumentException- if at least one argument has an incompatible number of dimensions.
- See Also:
 
- 
castOrCopyReturns 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, or- nullif none.
- Returns:
- a SIS implementation containing the values of the given object (may be the
         given object itself), or nullif the argument was null.
 
- 
getInterfaceReturns the GeoAPI interface implemented by this class. The SIS implementation returnsDerivedCRS.class.Note for implementers: Subclasses usually do not need to override this method since GeoAPI does not defineDerivedCRSsub-interface. Overriding possibility is left mostly for implementers who wish to extend GeoAPI with their own set of interfaces.- Returns:
- DerivedCRS.classor a user-defined sub-interface.
 
- 
getDatumReturns the datum of the base CRS.- Specified by:
- getDatumin interface- SingleCRS
- Returns:
- the datum of the base CRS.
 
- 
getBaseCRSReturns the CRS on which the conversion is applied. This CRS defines the datum of this CRS and (at least implicitly) the source of the conversion from base.- Specified by:
- getBaseCRSin interface- GeneralDerivedCRS
- Returns:
- the base coordinate reference system.
 
- 
getConversionFromBaseReturns the conversion 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 thisCRS.
- The conversion target CRS is thisCRS.
 Note: This is different than ISO 19111, which allows source and target CRS to benull.- Specified by:
- getConversionFromBasein interface- GeneralDerivedCRS
- Returns:
- the conversion to this CRS.
 
- The conversion source CRS
       is the base CRS of 
- 
getCoordinateSystemReturns the coordinate system.- Specified by:
- getCoordinateSystemin interface- CoordinateReferenceSystem
- Specified by:
- getCoordinateSystemin interface- SingleCRS
- Overrides:
- getCoordinateSystemin class- AbstractCRS
- Returns:
- the coordinate system.
 
- 
forConventionReturns 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:
- forConventionin 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:
 
- 
equalsCompares 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 givenComparisonModeisIGNORE_METADATAorAPPROXIMATE, then axis order of the base CRS are ignored (but not axis order of this derived CRS).- Specified by:
- equalsin interface- LenientComparable
- Parameters:
- object- the object to compare to- this.
- mode-- STRICTfor performing a strict comparison, or- IGNORE_METADATAfor comparing only properties relevant to coordinate transformations.
- Returns:
- trueif both objects are equal.
- See Also:
 
- 
computeHashCodeprotected 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.
 
- 
formatToFormats the inner part of the Well Known Text (WKT) representation of this CRS.- Overrides:
- formatToin class- AbstractCRS
- Parameters:
- formatter- the formatter where to format the inner content of this WKT element.
- Returns:
- "Fitted_CS"(WKT 1) or a type-dependent keyword (WKT 2).
- See Also:
 
 
-