Package com.esri.core.geometry
Class DatumTransformation
- java.lang.Object
-
- com.esri.core.geometry.DatumTransformation
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
CompositeGeographicTransformation
,CompositeHVDatumTransformation
public abstract class DatumTransformation extends Object implements Serializable
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
DatumTransformation.ITable
A interface to perform transformation lookup by name.static class
DatumTransformation.Type
-
Constructor Summary
Constructors Constructor Description DatumTransformation()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract int
count()
Returns the number of steps in this transformation.abstract DatumTransformation
createInverse()
Returns inverted transformation.static DatumTransformation
findTransformationByName(DatumTransformation.Type type, String name_expression, DatumTransformation.ITable customTransformations)
Finds a transformation by a name expression.abstract String
getName()
Returns the name of the composite transformation.abstract DatumTransformation.Type
getType()
Returns type of the transformation.abstract boolean
isMatchingTransformation(SpatialReference srFrom, SpatialReference srTo)
Checks if this transformation can be used with the given spatial references.abstract boolean
referencesMissingData()
Allows to check if the transformation references some missing data.abstract boolean
validateTransformation(SpatialReference srFrom, SpatialReference srTo)
Validates given transformation, by checking the whole transformation chain.
-
-
-
Method Detail
-
getType
public abstract DatumTransformation.Type getType()
Returns type of the transformation.
-
getName
public abstract String getName()
Returns the name of the composite transformation. This could be either a derived name or a user provided name. The derived name is created by appending the names of the underlying transformations, separated with '+' sign. Inverted transformations have tildas '~' prepended to their names. The user provided name is supplied by the user when the transformation is created with the editor.
-
count
public abstract int count()
Returns the number of steps in this transformation.
-
createInverse
public abstract DatumTransformation createInverse()
Returns inverted transformation.
-
referencesMissingData
public abstract boolean referencesMissingData()
Allows to check if the transformation references some missing data.- Returns:
- Returns true if the transformation references missing data (grid files). When it returns false, the transformation can find all required data files. Note, missing data files are in location generally referred to by Spatial_reference.get_pedata_folder. To determine the name of the missing data, use get_grid_name method.
-
isMatchingTransformation
public abstract boolean isMatchingTransformation(SpatialReference srFrom, SpatialReference srTo)
Checks if this transformation can be used with the given spatial references.- Parameters:
srFrom
- source spatial reference. It can be a pcs or a gcs.srTo
- destination spatial reference. It can be a pcs or a gcs.- Returns:
- Returns true if this transformation can be used to transform from srFrom to srTo.
-
validateTransformation
public abstract boolean validateTransformation(SpatialReference srFrom, SpatialReference srTo)
Validates given transformation, by checking the whole transformation chain.- Parameters:
srFrom
- source spatial reference. It can be a pcs or a gcs, can be null.srTo
- destination spatial reference. It can be a pcs or a gcs, can be null.- Returns:
- The result of true means the validation is successfull, The result of false, means that we could not validate. However, it does not necesseraly mean that the transformation is not usable, but only that we could not validate it. See also fix_internal_direction() method. Note: The only time you may want to call this method is when you a constructing a transformation manually. A similar method is used in GP Project Tool to display a warning when a selected transformation cannot be successfully validated. Example when the method would return false is for example, when the direction of transformation steps are messed up. It also returns false if from and to spatial references fon't match the transformation.
-
findTransformationByName
public static DatumTransformation findTransformationByName(DatumTransformation.Type type, String name_expression, DatumTransformation.ITable customTransformations)
Finds a transformation by a name expression.- Parameters:
type
- A type of transformation to find.name_expression
- The name expression that has the following grammar: Expr = Sum Sum = Value ['+' Value] Value = Name / '(' Expr ')' / '~'Value Name = WKID / RESTRICTED_NAME / '"'ANY_NAME'"' WKID = A well known ID of the geotransformation (a decimal value, that consists only of [0-9] digits) RESTRICTED_NAME Is the geotransformaion name that cannot contain the following symbols: '+', '~', '(', ')', '"' (double quotes). ANY_NAME Is the geotransformation name that can contain any symbols. The quotes must be escaped with '\' (for example: "blah \"blah\" blah"). SimpleExpr = RESTRICTED_NAME '+' RESTRICTED_NAME ['+' SimpleExpr] - a special kind of expression, see the note below.customTransformations
- Can be null. An optional lookup table for the custom transformations. The method uses the provided table to resolve a name if the name was not found among the known transformaions.- Returns:
- The found transformation, or null if it could not find any. The tilda character '~' means an inversion of direction of a transformation that immediately follows it. It can also be applied to an expression in parenthesis which means the whole expression is inverted. A quoted text (ANY_NAME) will be unquoted and the result text will be used as a lookup key for the transformation name. One usually would want to quote a transformation names that contain certain characters that cannot be contained in the RESTRICTED_NAME, especially to wrap a name of the custom transformation, which is more probably to contain those. Note: If the name_expression is SimpleExpr AND the type is Geographic, then the method will also analyse the transformation and will attempt to fix the direction of individual steps to make the transformations to connect properly (output of one match input of another). This behavior is to support GP tools for legacy transformations. If the method was unable to fix the direction the transformation is left as is.
-
-