Class AbstractProvider
java.lang.Object
org.apache.sis.io.wkt.FormattableObject
org.apache.sis.referencing.AbstractIdentifiedObject
org.apache.sis.referencing.operation.DefaultOperationMethod
org.apache.sis.internal.referencing.provider.AbstractProvider
- All Implemented Interfaces:
Serializable
,Formattable
,MathTransformProvider
,Deprecable
,LenientComparable
,org.opengis.referencing.IdentifiedObject
,org.opengis.referencing.operation.OperationMethod
- Direct Known Subclasses:
Affine
,AxisOrderReversal
,Equirectangular
,GeocentricToTopocentric
,GeodeticOperation
,GeographicToTopocentric
,Interpolation1D
,MapProjection
,MapProjection3D
,NADCON
,NorthPoleRotation
,NTv1
,NTv2
,PseudoPlateCarree
,SouthPoleRotation
,Wraparound
,ZonedTransverseMercator
public abstract class AbstractProvider
extends DefaultOperationMethod
implements MathTransformProvider
Base class for all providers defined in this package.
- Since:
- 0.6
- Version:
- 1.3
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Class
<? extends org.opengis.referencing.operation.SingleOperation> The base interface of theCoordinateOperation
instances that use this method.private static final long
For cross-version compatibility.final Class
<? extends org.opengis.referencing.cs.CoordinateSystem> The base interface of the coordinate system of source/target coordinates.final boolean
Flags whether the source and/or target ellipsoid are concerned by this operation.final Class
<? extends org.opengis.referencing.cs.CoordinateSystem> The base interface of the coordinate system of source/target coordinates.final boolean
Flags whether the source and/or target ellipsoid are concerned by this operation.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.operation.OperationMethod
FORMULA_KEY
-
Constructor Summary
ConstructorsModifierConstructorDescription(package private)
AbstractProvider
(Class<? extends org.opengis.referencing.operation.SingleOperation> operationType, org.opengis.parameter.ParameterDescriptorGroup parameters, Class<? extends org.opengis.referencing.cs.CoordinateSystem> sourceCSType, int sourceDimensions, boolean sourceOnEllipsoid, Class<? extends org.opengis.referencing.cs.CoordinateSystem> targetCSType, int targetDimensions, boolean targetOnEllipsoid) Constructs a math transform provider from a set of parameters.protected
AbstractProvider
(Map<String, ?> properties, int sourceDimension, int targetDimension, org.opengis.parameter.ParameterDescriptorGroup parameters) Constructs a math transform provider from the given properties and a set of parameters. -
Method Summary
Modifier and TypeMethodDescription(package private) static ParameterBuilder
addIdentifierAndLegacy
(ParameterBuilder builder, String code, String legacy) Adds an identifier code together with its previous (legacy) code.(package private) static ParameterBuilder
addNameAndLegacy
(ParameterBuilder builder, String name, String legacy) Adds a name together with its previous (legacy) name.(package private) static ParameterBuilder
builder()
Creates the parameter builder with the default namespace set to EPSG.(package private) static org.opengis.parameter.ParameterDescriptor
<Double> createLatitude
(ParameterBuilder builder, boolean includePoles) Creates a descriptor for a latitude parameter in degrees with a default value of 0°.(package private) static org.opengis.parameter.ParameterDescriptor
<Double> createLongitude
(ParameterBuilder builder) Creates a descriptor for a longitude parameter in degrees with a default value of 0°.(package private) static org.opengis.parameter.ParameterDescriptor
<Double> createMandatoryLatitude
(ParameterBuilder builder) Creates a descriptor for a latitude parameter in degrees without default value.(package private) static org.opengis.parameter.ParameterDescriptor
<Double> createScale
(ParameterBuilder builder) Creates a descriptor for a scale parameter with a default value of 1.(package private) static org.opengis.parameter.ParameterDescriptor
<Double> createShift
(ParameterBuilder builder) Creates a false easting, false northing or height parameter in metre with a default value of 0.(package private) static org.opengis.parameter.ParameterDescriptor
<Double> createZeroConstant
(ParameterBuilder builder) Creates a descriptor for a 0 constant value in degrees.final Class
<? extends org.opengis.referencing.operation.SingleOperation> Returns the interface implemented by the coordinate operation.inverse()
Returns the operation method which is the inverse of this method.(package private) static void
recoverableException
(Class<? extends AbstractProvider> caller, Exception e) Convenience method for reporting a non-fatal error at transform construction time.If an operation method is ambiguous according Apache SIS, returns the name of the method that SIS should use.toMap
(org.opengis.referencing.IdentifiedObject parameters) Work around for RFE #4093999 in Sun's bug database ("Relax constraint on placement of this()/super() call in constructors").Methods inherited from class org.apache.sis.referencing.operation.DefaultOperationMethod
castOrCopy, computeHashCode, equals, formatTo, getFormula, getInterface, getParameters, getSourceDimensions, getTargetDimensions, redimension, redimension
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.IdentifiedObject
getAlias, getIdentifiers, getName, getRemarks, toWKT
Methods inherited from interface org.apache.sis.referencing.operation.transform.MathTransformProvider
createMathTransform
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDFor cross-version compatibility.- See Also:
-
operationType
The base interface of theCoordinateOperation
instances that use this method.- See Also:
-
sourceCSType
The base interface of the coordinate system of source/target coordinates. This is used for resolving some ambiguities at WKT parsing time. -
targetCSType
The base interface of the coordinate system of source/target coordinates. This is used for resolving some ambiguities at WKT parsing time. -
sourceOnEllipsoid
public final boolean sourceOnEllipsoidFlags whether the source and/or target ellipsoid are concerned by this operation. Those flags are read byDefaultMathTransformFactory
for determining if this operation has"semi_major"
,"semi_minor"
,"src_semi_major"
,"src_semi_minor"
parameters that may need to be filled with values inferred from the source or targetDefaultGeodeticDatum
. Meaning of return values:- (
false
,false
) if neither the source coordinate system or the destination coordinate system is ellipsoidal. There are no parameters that need to be completed. - (
true
,false
) if this operation has"semi_major"
and"semi_minor"
parameters that need to be set to the axis lengths of the source ellipsoid. - (
false
,true
) if this operation has"semi_major"
and"semi_minor"
parameters that need to be set to the axis lengths of the target ellipsoid. - (
true
,true
) if this operation has"src_semi_major"
,"src_semi_minor"
,"tgt_semi_major"
and"tgt_semi_minor"
parameters that need to be set to the axis lengths of the source and target ellipsoids.
DefaultMathTransformFactory
will try to infer it from the type of user-specified source and target CRS. - (
-
targetOnEllipsoid
public final boolean targetOnEllipsoidFlags whether the source and/or target ellipsoid are concerned by this operation. Those flags are read byDefaultMathTransformFactory
for determining if this operation has"semi_major"
,"semi_minor"
,"src_semi_major"
,"src_semi_minor"
parameters that may need to be filled with values inferred from the source or targetDefaultGeodeticDatum
. Meaning of return values:- (
false
,false
) if neither the source coordinate system or the destination coordinate system is ellipsoidal. There are no parameters that need to be completed. - (
true
,false
) if this operation has"semi_major"
and"semi_minor"
parameters that need to be set to the axis lengths of the source ellipsoid. - (
false
,true
) if this operation has"semi_major"
and"semi_minor"
parameters that need to be set to the axis lengths of the target ellipsoid. - (
true
,true
) if this operation has"src_semi_major"
,"src_semi_minor"
,"tgt_semi_major"
and"tgt_semi_minor"
parameters that need to be set to the axis lengths of the source and target ellipsoids.
DefaultMathTransformFactory
will try to infer it from the type of user-specified source and target CRS. - (
-
-
Constructor Details
-
AbstractProvider
protected AbstractProvider(Map<String, ?> properties, int sourceDimension, int targetDimension, org.opengis.parameter.ParameterDescriptorGroup parameters) Constructs a math transform provider from the given properties and a set of parameters.- Parameters:
properties
- set of properties. Shall contain at least"name"
.sourceDimension
- number of dimensions in the source CRS of this operation method.targetDimension
- number of dimensions in the target CRS of this operation method.parameters
- the set of parameters (nevernull
).
-
AbstractProvider
AbstractProvider(Class<? extends org.opengis.referencing.operation.SingleOperation> operationType, org.opengis.parameter.ParameterDescriptorGroup parameters, Class<? extends org.opengis.referencing.cs.CoordinateSystem> sourceCSType, int sourceDimensions, boolean sourceOnEllipsoid, Class<? extends org.opengis.referencing.cs.CoordinateSystem> targetCSType, int targetDimensions, boolean targetOnEllipsoid) Constructs a math transform provider from a set of parameters. The provider name and identifiers will be the same than the parameter ones.- Parameters:
operationType
- base interface of theCoordinateOperation
instances that use this method.parameters
- description of parameters expected by this operation.sourceCSType
- base interface of the coordinate system of source coordinates.sourceDimensions
- number of dimensions in the source CRS of this operation method.sourceOnEllipsoid
- whether the operation needs source ellipsoid axis lengths.targetCSType
- base interface of the coordinate system of target coordinates.targetDimensions
- number of dimensions in the target CRS of this operation method.targetOnEllipsoid
- whether the operation needs target ellipsoid axis lengths.
-
-
Method Details
-
toMap
@Workaround(library="JDK", version="1.7") private static Map<String,Object> toMap(org.opengis.referencing.IdentifiedObject parameters) Work around for RFE #4093999 in Sun's bug database ("Relax constraint on placement of this()/super() call in constructors"). -
builder
Creates the parameter builder with the default namespace set to EPSG. -
addNameAndLegacy
Adds a name together with its previous (legacy) name. The legacy name will be added as a deprecated alias. -
addIdentifierAndLegacy
static ParameterBuilder addIdentifierAndLegacy(ParameterBuilder builder, String code, String legacy) Adds an identifier code together with its previous (legacy) code. The legacy code will be added as a deprecated identifier. -
createZeroConstant
static org.opengis.parameter.ParameterDescriptor<Double> createZeroConstant(ParameterBuilder builder) Creates a descriptor for a 0 constant value in degrees.- See Also:
-
createMandatoryLatitude
static org.opengis.parameter.ParameterDescriptor<Double> createMandatoryLatitude(ParameterBuilder builder) Creates a descriptor for a latitude parameter in degrees without default value. This method is used for latitude of origin that cannot be zero, of for standard parallels where the default value should be the value of another parameter instead of 0°. -
createLatitude
static org.opengis.parameter.ParameterDescriptor<Double> createLatitude(ParameterBuilder builder, boolean includePoles) Creates a descriptor for a latitude parameter in degrees with a default value of 0°. -
createLongitude
Creates a descriptor for a longitude parameter in degrees with a default value of 0°. -
createScale
Creates a descriptor for a scale parameter with a default value of 1. -
createShift
Creates a false easting, false northing or height parameter in metre with a default value of 0. -
resolveAmbiguity
If an operation method is ambiguous according Apache SIS, returns the name of the method that SIS should use. Otherwise returnsnull
. The ambiguities that need to be resolved are:- Method "Geographic/geocentric conversions" (EPSG:9602) can be either:
"Ellipsoid_To_Geocentric"
(implemented byGeographicToGeocentric
"Geocentric_To_Ellipsoid"
(implemented byGeocentricToGeographic
- Parameters:
context
- the potentially ambiguous context.- Returns:
- name of the provider to use, or
null
if there is nothing to change. - Since:
- 0.8
- Method "Geographic/geocentric conversions" (EPSG:9602) can be either:
-
getOperationType
Returns the interface implemented by the coordinate operation. This method returns the type specified at construction time.- Overrides:
getOperationType
in classDefaultOperationMethod
- Returns:
- interface implemented by all coordinate operations that use this method.
- See Also:
-
inverse
Returns the operation method which is the inverse of this method.- If
null
, no inverse method is easily available. This is the default. - If
this
, the inverse of this operation method is the same operation method with some parameter values changed (typically with sign inverted). - If another method, it should take the same parameter values.
This is a SIS-specific information which may be changed in any future SIS version. Current implementation provides this information in a "all or nothing" way: either all parameter values can have their sign reversed, or either the operation is considered not revertible at all. This is different than the EPSG dataset in two way:
- EPSG provides an equivalent information in the
PARAM_SIGN_REVERSAL
column of the[Coordinate_Operation Parameter Usage]
table, but on a parameter-by-parameter basis instead of for the whole operation (which is probably better). - EPSG provides another information in the
REVERSE_OP
column of the[Coordinate_Operation Method]
table, but this is not equivalent to this method because it does not differentiate the map projection methods from inverse map projection methods.
- Returns:
- the inverse of this operation method (possibly
this
), ornull
if none. - See Also:
- If
-
recoverableException
Convenience method for reporting a non-fatal error at transform construction time. This method assumes that the error occurred (indirectly) during execution ofMathTransformProvider.createMathTransform(MathTransformFactory, ParameterValueGroup)
.- Parameters:
caller
- the provider class in which the error occurred.e
- the error that occurred.
-