Class AbstractCoordinateOperation
Object
Formattable
AbstractIdentifiedObject
AbstractCoordinateOperation
- All Implemented Interfaces:
Serializable,IdentifiedObject,CoordinateOperation
- Direct Known Subclasses:
DefaultConcatenatedOperation,DefaultSingleOperation
public class AbstractCoordinateOperation
extends AbstractIdentifiedObject
implements CoordinateOperation
Establishes an association between a source and a target coordinate reference system, and provides a
transform for transforming coordinates in the source CRS to coordinates in the target CRS.
Many but not all coordinate operations (from coordinate reference system
A to coordinate reference system B) also uniquely define
the inverse operation (from coordinate reference system B to
coordinate reference system A). In some cases, the operation method
algorithm for the inverse operation is the same as for the forward algorithm, but the signs of some operation
parameter values must be reversed. In other cases, different algorithms are required for the forward and inverse
operations, but the same operation parameter values are used. If (some) entirely different parameter values are
needed, a different coordinate operation shall be defined.
This class is conceptually abstract, even if it is technically possible to instantiate it. Typical
applications should create instances of the most specific subclass with Default prefix instead. An exception
to this rule may occurs when it is not possible to identify the exact type.
- Since:
- 2.1
- Author:
- Martin Desruisseaux (IRD)
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ExtentArea in which this operation is valid, ornullif not available.static final PositionalAccuracy[]An empty array of positional accuracy.protected final CoordinateReferenceSystemThe source CRS, ornullif not available.protected final CoordinateReferenceSystemThe target CRS, ornullif not available.protected final MathTransformTransform from positions in the source coordinate reference system to positions in the target coordinate reference system.Fields inherited from class AbstractIdentifiedObject
EMPTY_ALIAS_ARRAY, EMPTY_IDENTIFIER_ARRAY, IDENTIFIER_COMPARATOR, NAME_COMPARATOR, REMARKS_COMPARATORFields inherited from class Formattable
SINGLE_LINEFields inherited from interface CoordinateOperation
COORDINATE_OPERATION_ACCURACY_KEY, DOMAIN_OF_VALIDITY_KEY, OPERATION_VERSION_KEY, SCOPE_KEYFields inherited from interface IdentifiedObject
ALIAS_KEY, IDENTIFIERS_KEY, NAME_KEY, REMARKS_KEY -
Constructor Summary
ConstructorsConstructorDescriptionAbstractCoordinateOperation(Map<String, ?> properties, CoordinateReferenceSystem sourceCRS, CoordinateReferenceSystem targetCRS, MathTransform transform) Constructs a coordinate operation from a set of properties. -
Method Summary
Modifier and TypeMethodDescriptionbooleanequals(AbstractIdentifiedObject object, boolean compareMetadata) Compares this coordinate operation with the specified object for equality.protected StringFormat this operation as a pseudo-WKT format.doubleConvenience method returning the accuracy in meters.static doublegetAccuracy(CoordinateOperation operation) Convenience method returning the accuracy in meters for the specified operation.Estimate(s) of the impact of this operation on point accuracy.Area or region or timeframe in which this coordinate operation is valid.Gets the math transform.Version of the coordinate transformation (i.e., instantiation due to the stochastic nature of the parameters).getScope()Description of domain of usage, or limitations of usage, for which this operation is valid.Returns the source CRS.Returns the target CRS.static Class<? extends CoordinateOperation>getType(CoordinateOperation object) Returns the most specific GeoAPI interface implemented by the specified operation.inthashCode()Returns a hash code value for this coordinate operation.Methods inherited from class AbstractIdentifiedObject
asSet, ensureAngularUnit, ensureLinearUnit, ensureNonNull, ensureNonNull, ensureTimeUnit, equals, equals, equals, equals, getAlias, getIdentifier, getIdentifier, getIdentifiers, getName, getName, getName, getProperties, getProperties, getRemarks, nameMatches, nameMatches, nameMatchesMethods inherited from class Formattable
cleanupThreadLocals, toString, toWKT, toWKT, toWKT, toWKTMethods inherited from interface IdentifiedObject
getAlias, getIdentifiers, getName, getRemarks, toWKT
-
Field Details
-
EMPTY_ACCURACY_ARRAY
An empty array of positional accuracy. This is usefull for fetching accuracies as an array, using the following idiom:getCoordinateOperationAccuracy().toArray(EMPTY_ACCURACY_ARRAY);
-
sourceCRS
The source CRS, ornullif not available. -
targetCRS
The target CRS, ornullif not available. -
domainOfValidity
Area in which this operation is valid, ornullif not available. -
transform
Transform from positions in the source coordinate reference system to positions in the target coordinate reference system.
-
-
Constructor Details
-
AbstractCoordinateOperation
public AbstractCoordinateOperation(Map<String, ?> properties, CoordinateReferenceSystem sourceCRS, CoordinateReferenceSystem targetCRS, MathTransform transform) Constructs a coordinate operation from a set of properties. The properties given in argument follow the same rules than for the super-class constructor. Additionally, the following properties are understood by this construtor:Property name Value type Value given to "operationVersion" StringgetOperationVersion()"coordinateOperationAccuracy" PositionalAccuracy[]getCoordinateOperationAccuracy()"domainOfValidity" ExtentgetDomainOfValidity()"scope" StringorInternationalStringgetScope()- Parameters:
properties- Set of properties. Should contains at least"name".sourceCRS- The source CRS.targetCRS- The target CRS.transform- Transform from positions in the source CRS to positions in the target CRS.
-
-
Method Details
-
getSourceCRS
Returns the source CRS.- Specified by:
getSourceCRSin interfaceCoordinateOperation- Returns:
- The source CRS, or
nullif not available. - See Also:
-
getTargetCRS
Returns the target CRS.- Specified by:
getTargetCRSin interfaceCoordinateOperation- Returns:
- The target CRS, or
nullif not available. - See Also:
-
getOperationVersion
Version of the coordinate transformation (i.e., instantiation due to the stochastic nature of the parameters). Mandatory when describing a transformation, and should not be supplied for a conversion.- Specified by:
getOperationVersionin interfaceCoordinateOperation- Returns:
- The coordinate operation version, or
nullin none.
-
getCoordinateOperationAccuracy
Estimate(s) of the impact of this operation on point accuracy. Gives position error estimates for target coordinates of this coordinate operation, assuming no errors in source coordinates.- Specified by:
getCoordinateOperationAccuracyin interfaceCoordinateOperation- Returns:
- The position error estimates, or an empty collection if not available.
- Since:
- 2.4
- See Also:
-
getAccuracy
public double getAccuracy()Convenience method returning the accuracy in meters. The default implementation delegates togetAccuracy(this). Subclasses should override this method if they can provide a more accurate algorithm.- Returns:
- The accuracy in meters, or NaN if unknown.
- Since:
- 2.2
-
getAccuracy
Convenience method returning the accuracy in meters for the specified operation. This method try each of the following procedures and returns the first successful one:- If a quantitative positional accuracy is found with a linear unit, then this accuracy estimate is converted to meters and returned.
- Otherwise, if the operation is a conversion, then returns 0 since a conversion is by definition accurates up to rounding errors.
- Otherwise, if the operation is a transformation, then checks if the datum shift
were applied with the help of Bursa-Wolf parameters. This procedure looks for Geotools-specific
DATUM_SHIFT_APPLIEDandDATUM_SHIFT_OMITTEDmetadata. If a datum shift has been applied, returns 25 meters. If a datum shift should have been applied but has been omitted, returns 1000 meters. The 1000 meters value is higher than the highest value (999 meters) found in the EPSG database version 6.7. The 25 meters value is the next highest value found in the EPSG database for a significant number of transformations. - Otherwise, if the operation is a concatenated one, returns the sum of the accuracy of all components.
- Parameters:
operation- The operation to inspect for accuracy.- Returns:
- The accuracy estimate (always in meters), or NaN if unknow.
- Since:
- 2.2
-
getDomainOfValidity
Area or region or timeframe in which this coordinate operation is valid. Returnsnullif not available.- Specified by:
getDomainOfValidityin interfaceCoordinateOperation- Returns:
- The coordinate operation valid domain, or
nullif not available. - Since:
- 2.4
-
getScope
Description of domain of usage, or limitations of usage, for which this operation is valid.- Specified by:
getScopein interfaceCoordinateOperation- Returns:
- A description of domain of usage, or
nullif none.
-
getMathTransform
Gets the math transform. The math transform will transform positions in the source coordinate reference system into positions in the target coordinate reference system.- Specified by:
getMathTransformin interfaceCoordinateOperation- Returns:
- The transform from source to target CRS, or
nullif not applicable.
-
getType
Returns the most specific GeoAPI interface implemented by the specified operation.- Parameters:
object- A coordinate operation.- Returns:
- The most specific GeoAPI interface (e.g.
Transformation.class).
-
equals
Compares this coordinate operation with the specified object for equality. IfcompareMetadataistrue, then all available properties are compared including domain of validity and scope.- Overrides:
equalsin classAbstractIdentifiedObject- Parameters:
object- The object to compare tothis.compareMetadata-truefor performing a strict comparaison, orfalsefor comparing only properties relevant to transformations.- Returns:
trueif both objects are equal.
-
hashCode
public int hashCode()Returns a hash code value for this coordinate operation.- Overrides:
hashCodein classAbstractIdentifiedObject- Returns:
- The hash code value. This value doesn't need to be the same in past or future versions of this class.
-
formatWKT
Format this operation as a pseudo-WKT format. No WKT format were defined for coordinate operation at the time this method was written. This method may change in any future version until a standard format is found.- Overrides:
formatWKTin classFormattable- Parameters:
formatter- The formatter to use.- Returns:
- The WKT element name.
- See Also:
-