Class AbstractDerivedCRS<C extends org.opengis.referencing.operation.Conversion>
- Type Parameters:
C
- the conversion type, eitherConversion
orProjection
.
- All Implemented Interfaces:
Serializable
,Formattable
,Deprecable
,LenientComparable
,org.opengis.referencing.crs.CoordinateReferenceSystem
,org.opengis.referencing.crs.GeneralDerivedCRS
,org.opengis.referencing.crs.SingleCRS
,org.opengis.referencing.IdentifiedObject
,org.opengis.referencing.ReferenceSystem
- Direct Known Subclasses:
DefaultDerivedCRS
,DefaultProjectedCRS
- Since:
- 0.6
- Version:
- 1.3
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate C
The conversion from the base CRS to this CRS.private static final long
Serial number for inter-operability with different versions.Fields inherited from class org.apache.sis.referencing.AbstractIdentifiedObject
DEPRECATED_KEY, LOCALE_KEY
Fields inherited from interface org.opengis.referencing.IdentifiedObject
ALIAS_KEY, IDENTIFIERS_KEY, NAME_KEY, REMARKS_KEY
Fields inherited from interface org.opengis.referencing.ReferenceSystem
DOMAIN_OF_VALIDITY_KEY, SCOPE_KEY
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new object in which every attributes are set to a null value.AbstractDerivedCRS
(Map<String, ?> properties, org.opengis.referencing.crs.SingleCRS baseCRS, org.opengis.referencing.crs.CoordinateReferenceSystem interpolationCRS, org.opengis.referencing.operation.OperationMethod method, org.opengis.referencing.operation.MathTransform baseToDerived, org.opengis.referencing.cs.CoordinateSystem derivedCS) ForDefaultDerivedCRS(Map, SingleCRS, CoordinateReferenceSystem, OperationMethod, MathTransform, CoordinateSystem)
constructor only (not legal forProjectedCRS
).AbstractDerivedCRS
(Map<String, ?> properties, org.opengis.referencing.crs.SingleCRS baseCRS, org.opengis.referencing.operation.Conversion conversion, org.opengis.referencing.cs.CoordinateSystem derivedCS) Creates a derived CRS from a defining conversion.AbstractDerivedCRS
(org.opengis.referencing.crs.GeneralDerivedCRS crs) Constructs a new coordinate reference system with the same values than the specified one. -
Method Summary
Modifier and TypeMethodDescriptionprivate void
afterUnmarshal
(Unmarshaller unmarshaller, Object parent) Invoked by JAXB after all elements have been unmarshalled.protected long
Invoked byhashCode()
for computing the hash code when first needed.private C
createConversionFromBase
(Map<String, ?> properties, org.opengis.referencing.crs.SingleCRS baseCRS, org.opengis.referencing.operation.Conversion conversion) Creates the conversion instance to associate with thisAbstractDerivedCRS
.boolean
equals
(Object object, ComparisonMode mode) Compares this coordinate reference system with the specified object for equality.Returns the conversion from the base CRS to this CRS.Returns the type of conversion associated to thisAbstractDerivedCRS
.abstract org.opengis.referencing.datum.Datum
getDatum()
Returns the datum of the base CRS.abstract Class<? extends org.opengis.referencing.crs.GeneralDerivedCRS>
Returns the GeoAPI interface implemented by this class.(package private) final void
setBaseCRS
(String name, org.opengis.referencing.crs.SingleCRS baseCRS) Stores a temporary association to the given base CRS.private void
setConversionFromBase
(C conversion) Invoked by JAXB at unmarshalling time for setting the defining conversion.Methods inherited from class org.apache.sis.referencing.crs.AbstractCRS
castOrCopy, createSameType, forConvention, formatCS, formatTo, getCached, getCoordinateSystem, getCoordinateSystem, isBaseCRS, setCached, setCoordinateSystem
Methods inherited from class org.apache.sis.referencing.AbstractReferenceSystem
getDomainOfValidity, getScope
Methods inherited from class org.apache.sis.referencing.AbstractIdentifiedObject
castOrCopy, equals, formatTo, getAlias, getDescription, getIdentifiers, getName, getRemarks, hashCode, isDeprecated, isHeuristicMatchForName
Methods inherited from class org.apache.sis.io.wkt.FormattableObject
print, toString, toString, toWKT
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.opengis.referencing.crs.GeneralDerivedCRS
getBaseCRS
Methods inherited from interface org.opengis.referencing.IdentifiedObject
getAlias, getIdentifiers, getName, getRemarks, toWKT
Methods inherited from interface org.opengis.referencing.ReferenceSystem
getDomainOfValidity, getScope
Methods inherited from interface org.opengis.referencing.crs.SingleCRS
getCoordinateSystem
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerial number for inter-operability with different versions.- See Also:
-
conversionFromBase
The conversion from the base CRS to this CRS. The base CRS of thisGeneralDerivedCRS
isConversion.getSourceCRS()
.Consider this field as final! This field is modified only at unmarshalling time by
setConversionFromBase(Conversion)
- See Also:
-
-
Constructor Details
-
AbstractDerivedCRS
AbstractDerivedCRS(Map<String, ?> properties, org.opengis.referencing.crs.SingleCRS baseCRS, org.opengis.referencing.operation.Conversion conversion, org.opengis.referencing.cs.CoordinateSystem derivedCS) throws org.opengis.geometry.MismatchedDimensionExceptionCreates a derived CRS from a defining conversion. The properties given in argument follow the same rules than for the super-class 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:
org.opengis.geometry.MismatchedDimensionException
- if the source and target dimensions ofbaseToDerived
do not match the dimensions ofbase
andderivedCS
respectively.
-
AbstractDerivedCRS
AbstractDerivedCRS(Map<String, ?> properties, org.opengis.referencing.crs.SingleCRS baseCRS, org.opengis.referencing.crs.CoordinateReferenceSystem interpolationCRS, org.opengis.referencing.operation.OperationMethod method, org.opengis.referencing.operation.MathTransform baseToDerived, org.opengis.referencing.cs.CoordinateSystem derivedCS) throws org.opengis.geometry.MismatchedDimensionExceptionForDefaultDerivedCRS(Map, SingleCRS, CoordinateReferenceSystem, OperationMethod, MathTransform, CoordinateSystem)
constructor only (not legal forProjectedCRS
).- Throws:
org.opengis.geometry.MismatchedDimensionException
-
AbstractDerivedCRS
AbstractDerivedCRS(org.opengis.referencing.crs.GeneralDerivedCRS 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.
-
AbstractDerivedCRS
AbstractDerivedCRS()Constructs a new object in which every attributes are set to a null 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
-
createConversionFromBase
private C createConversionFromBase(Map<String, ?> properties, org.opengis.referencing.crs.SingleCRS baseCRS, org.opengis.referencing.operation.Conversion conversion) Creates the conversion instance to associate with thisAbstractDerivedCRS
.WARNING: this method is invoked at construction time and will invoke indirectly (through
DefaultConversion
) theAbstractCRS.getCoordinateSystem()
method onthis
. Consequently, this method shall be invoked only after the construction of thisAbstractDerivedCRS
instance is advanced enough for allowing thegetCoordinateSystem()
method to execute. Subclasses may consider to make thegetCoordinateSystem()
method final for better guarantees. -
getConversionType
Returns the type of conversion associated to thisAbstractDerivedCRS
.WARNING: this method is invoked (indirectly) at construction time. Consequently, it shall return a constant value - this method is not allowed to depend on the object state.
-
getInterface
Returns the GeoAPI interface implemented by this class.- Overrides:
getInterface
in classAbstractCRS
- Returns:
- the coordinate reference system interface implemented by this class.
-
getDatum
public abstract org.opengis.referencing.datum.Datum getDatum()Returns the datum of the base CRS.- Specified by:
getDatum
in interfaceorg.opengis.referencing.crs.SingleCRS
- Overrides:
getDatum
in classAbstractCRS
- Returns:
- the datum of the base CRS.
-
getConversionFromBase
Returns the conversion from the base CRS to this CRS.- Specified by:
getConversionFromBase
in interfaceorg.opengis.referencing.crs.GeneralDerivedCRS
- Returns:
- the conversion to this CRS.
-
equals
Compares this coordinate reference system with the specified object for equality.- Specified by:
equals
in interfaceLenientComparable
- Overrides:
equals
in classAbstractCRS
- 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.- Overrides:
computeHashCode
in classAbstractCRS
- Returns:
- the hash code value. This value may change in any future Apache SIS version.
-
setConversionFromBase
Invoked by JAXB at unmarshalling time for setting the defining conversion. At this state, the given conversion has nullsourceCRS
andtargetCRS
. Those CRS will be set later, inafterUnmarshal(Unmarshaller, Object)
. -
setBaseCRS
Stores a temporary association to the given base CRS. This method shall be invoked only after the call tosetConversionFromBase(Conversion)
, otherwise an exception will be thrown.The given base CRS will not be stored in this
AbstractDerivedCRS
instance now, but in another temporary location. The reason is that we need the coordinate system (CS) before we can set thebaseCRS
in its final location, but the CS is not yet known when this method is invoked.- Parameters:
name
- the property name, used only in case of error message to format.- Throws:
IllegalStateException
- if the base CRS cannot be set.
-
afterUnmarshal
Invoked by JAXB after all elements have been unmarshalled. At this point we should have the coordinate system (CS). The CS information is required bycreateConversionFromBase(…)
in order to create aMathTransform
with correct axis swapping and unit conversions.
-