Class MapProjection
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
org.apache.sis.internal.referencing.provider.MapProjection
- All Implemented Interfaces:
Serializable
,Formattable
,MathTransformProvider
,Deprecable
,LenientComparable
,org.opengis.referencing.IdentifiedObject
,org.opengis.referencing.operation.OperationMethod
- Direct Known Subclasses:
AbstractLambert
,AbstractMercator
,AbstractStereographic
,AlbersEqualArea
,AzimuthalEquidistantSpherical
,CassiniSoldner
,LambertAzimuthalEqualArea
,LambertCylindricalEqualArea
,LambertCylindricalEqualAreaSpherical
,ModifiedAzimuthalEquidistant
,Mollweide
,Orthographic
,Polyconic
,SatelliteTracking
,Sinusoidal
Base class for most two-dimensional map projection providers defined in this package.
This base class defines some descriptors for the most commonly used parameters.
Subclasses will declare additional parameters and group them in a
descriptor group named
PARAMETERS
.- Since:
- 0.6
- Version:
- 1.3
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DefaultParameterDescriptor<Double>
The ellipsoid eccentricity, computed from the semi-major and semi-minor axis lengths.private org.opengis.referencing.operation.OperationMethod
Deprecated.ISO 19111:2019 removed source/target dimensions attributes.static final DefaultParameterDescriptor<Double>
All names known to Apache SIS for the semi-major parameter.static final DefaultParameterDescriptor<Double>
All names known to Apache SIS for the semi-minor parameter.private static final long
Serial number for inter-operability with different versions.Fields inherited from class org.apache.sis.internal.referencing.provider.AbstractProvider
sourceCSType, sourceOnEllipsoid, targetCSType, targetOnEllipsoid
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
ConstructorsModifierConstructorDescriptionprotected
MapProjection
(Class<? extends org.opengis.referencing.operation.Projection> operationType, org.opengis.parameter.ParameterDescriptorGroup parameters) Constructs a math transform provider from a set of parameters. -
Method Summary
Modifier and TypeMethodDescriptionfinal org.opengis.referencing.operation.MathTransform
createMathTransform
(org.opengis.referencing.operation.MathTransformFactory factory, org.opengis.parameter.ParameterValueGroup parameters) Creates a map projection from the specified group of parameter values.protected abstract NormalizedProjection
createProjection
(Parameters parameters) Creates a map projection on an ellipsoid having a semi-major axis length of 1.(package private) static org.opengis.util.InternationalString
notFormalParameter
(String origin) Creates a remarks for parameters that are not formally EPSG parameter.final org.opengis.referencing.operation.OperationMethod
redimension
(int sourceDimensions, int targetDimensions) Deprecated.ISO 19111:2019 removed source/target dimensions attributes.(package private) static ParameterBuilder
renameAlias
(ParameterBuilder builder, org.opengis.parameter.ParameterDescriptor<Double> template, org.opengis.metadata.citation.Citation toRename, org.opengis.parameter.ParameterDescriptor<Double> replacement) Copies name, aliases and identifiers of the giventemplate
, except the alias and identifiers of the given authority which are replaced by the alias and identifiers of the same authority inreplacement
.(package private) static ParameterBuilder
renameAlias
(ParameterBuilder builder, org.opengis.parameter.ParameterDescriptor<Double> template, org.opengis.metadata.citation.Citation s1, org.opengis.parameter.ParameterDescriptor<Double> r1, org.opengis.metadata.citation.Citation s2, org.opengis.parameter.ParameterDescriptor<Double> r2) Same as aboverenameAlias(…)
but with two aliases to rename.private static void
renameAliases
(ParameterBuilder builder, org.opengis.parameter.ParameterDescriptor<Double> template, org.opengis.metadata.citation.Citation[] toRename, org.opengis.parameter.ParameterDescriptor<?>[] replacement) Implementation ofrenameAlias(…)
methods.private static org.opengis.util.GenericName
sameNameAs
(org.opengis.metadata.citation.Citation authority, org.opengis.parameter.GeneralParameterDescriptor parameters) Returns the name of the given authority declared in the given parameter descriptor.static void
Validates the given parameter value.Methods inherited from class org.apache.sis.internal.referencing.provider.AbstractProvider
addIdentifierAndLegacy, addNameAndLegacy, builder, createLatitude, createLongitude, createMandatoryLatitude, createScale, createShift, createZeroConstant, getOperationType, inverse, recoverableException, resolveAmbiguity
Methods inherited from class org.apache.sis.referencing.operation.DefaultOperationMethod
castOrCopy, computeHashCode, equals, formatTo, getFormula, getInterface, getParameters, getSourceDimensions, getTargetDimensions, 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
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerial number for inter-operability with different versions.- See Also:
-
SEMI_MAJOR
All names known to Apache SIS for the semi-major parameter. This parameter is mandatory and has no default value. The range of valid values is (0 … ∞).Some names for this parameter are
"semi_major"
,"SemiMajorAxis"
and"a"
.Parameter names OGC: semi_major ESRI: Semi_Major NetCDF: semi_major_axis GeoTIFF: SemiMajorAxis Proj4: a - Value domain: (0.0 … ∞) m
- No default value
-
SEMI_MINOR
All names known to Apache SIS for the semi-minor parameter. This parameter is mandatory and has no default value. The range of valid values is (0 … ∞).Some names for this parameter are
"semi_minor"
,"SemiMinorAxis"
and"b"
.Parameter names OGC: semi_minor ESRI: Semi_Minor NetCDF: semi_minor_axis GeoTIFF: SemiMinorAxis Proj4: b - Value domain: (0.0 … ∞) m
- No default value
-
ECCENTRICITY
The ellipsoid eccentricity, computed from the semi-major and semi-minor axis lengths. This a SIS-specific parameter.Parameter names SIS: eccentricity - Value domain: [0.0 … 1.0]
- No default value
-
redimensioned
Deprecated.ISO 19111:2019 removed source/target dimensions attributes.The three-dimensional counterpart of this two-dimensional map projection. This is created when first needed.
-
-
Constructor Details
-
MapProjection
protected MapProjection(Class<? extends org.opengis.referencing.operation.Projection> operationType, org.opengis.parameter.ParameterDescriptorGroup parameters) Constructs a math transform provider from a set of parameters. The provider identifiers will be the same than the parameter ones.- Parameters:
operationType
- interface of theCoordinateOperation
instances that use this projection.parameters
- the set of parameters (nevernull
).
-
-
Method Details
-
redimension
@Deprecated public final org.opengis.referencing.operation.OperationMethod redimension(int sourceDimensions, int targetDimensions) Deprecated.ISO 19111:2019 removed source/target dimensions attributes.Returns this operation method with the specified number of dimensions. The number of dimensions can be only 2 or 3, and must be the same for source and target CRS.- Overrides:
redimension
in classDefaultOperationMethod
- Parameters:
sourceDimensions
- the desired number of input dimensions.targetDimensions
- the desired number of output dimensions.- Returns:
- the redimensioned projection method, or
this
if no change is needed. - Since:
- 0.8
-
validate
public static void validate(org.opengis.parameter.ParameterDescriptor<? extends Number> descriptor, double value) throws IllegalArgumentException Validates the given parameter value. This method duplicates the verification already done byDefaultParameterValue.setValue(Object, Unit)
. But we check again because we have no guarantee that the parameters given by the user were instances ofDefaultParameterValue
, or that the descriptor associated to the user-specifiedParameterValue
has sufficient information.- Parameters:
descriptor
- the descriptor that specify the parameter to validate.value
- the parameter value in the units given by the descriptor.- Throws:
IllegalArgumentException
- if the given value is out of bounds.- See Also:
-
createMathTransform
public final org.opengis.referencing.operation.MathTransform createMathTransform(org.opengis.referencing.operation.MathTransformFactory factory, org.opengis.parameter.ParameterValueGroup parameters) throws org.opengis.parameter.ParameterNotFoundException, org.opengis.util.FactoryException Creates a map projection from the specified group of parameter values.- Parameters:
factory
- the factory to use for creating and concatenating the (de)normalization transforms.parameters
- the group of parameter values.- Returns:
- the map projection created from the given parameter values.
- Throws:
org.opengis.parameter.ParameterNotFoundException
- if a required parameter was not found.org.opengis.util.FactoryException
- if the map projection cannot be created.
-
createProjection
protected abstract NormalizedProjection createProjection(Parameters parameters) throws org.opengis.parameter.ParameterNotFoundException Creates a map projection on an ellipsoid having a semi-major axis length of 1.- Parameters:
parameters
- the group of parameter values.- Returns:
- the map projection created from the given parameter values.
- Throws:
org.opengis.parameter.ParameterNotFoundException
- if a required parameter was not found.
-
sameNameAs
private static org.opengis.util.GenericName sameNameAs(org.opengis.metadata.citation.Citation authority, org.opengis.parameter.GeneralParameterDescriptor parameters) Returns the name of the given authority declared in the given parameter descriptor. This method is used only as a way to avoid creating many instances of the same name.- Parameters:
authority
- the authority for which to get the name.parameters
- where to get name for the given authority.- Throws:
NoSuchElementException
- if the given authority has not been found.
-
renameAlias
static ParameterBuilder renameAlias(ParameterBuilder builder, org.opengis.parameter.ParameterDescriptor<Double> template, org.opengis.metadata.citation.Citation toRename, org.opengis.parameter.ParameterDescriptor<Double> replacement) Copies name, aliases and identifiers of the giventemplate
, except the alias and identifiers of the given authority which are replaced by the alias and identifiers of the same authority inreplacement
.- Parameters:
builder
- an initially clean builder where to add the names and identifiers.template
- the parameter from which to copy names and identifiers.toRename
- authority of the alias to rename.replacement
- the parameter from which to get the new name for the alias to rename.- Returns:
- the given
builder
, for method call chaining. - Since:
- 0.8
-
renameAlias
static ParameterBuilder renameAlias(ParameterBuilder builder, org.opengis.parameter.ParameterDescriptor<Double> template, org.opengis.metadata.citation.Citation s1, org.opengis.parameter.ParameterDescriptor<Double> r1, org.opengis.metadata.citation.Citation s2, org.opengis.parameter.ParameterDescriptor<Double> r2) Same as aboverenameAlias(…)
but with two aliases to rename.- Parameters:
builder
- an initially clean builder where to add the names and identifiers.template
- the parameter from which to copy names and identifiers.s1
- authority of the first alias to rename.r1
- the parameter from which to get the new name for the first alias to rename.s2
- authority of the second alias to rename.r2
- the parameter from which to get the new name for the second alias to rename.- Returns:
- the given
builder
, for method call chaining. - Since:
- 1.1
-
renameAliases
private static void renameAliases(ParameterBuilder builder, org.opengis.parameter.ParameterDescriptor<Double> template, org.opengis.metadata.citation.Citation[] toRename, org.opengis.parameter.ParameterDescriptor<?>[] replacement) Implementation ofrenameAlias(…)
methods. -
notFormalParameter
Creates a remarks for parameters that are not formally EPSG parameter.- Parameters:
origin
- the name of the projection for where the parameter is formally used.- Returns:
- a remarks saying that the parameter is actually defined in
origin
.
-