Class TransverseMercator.Spherical
java.lang.Object
org.apache.sis.io.wkt.FormattableObject
org.apache.sis.referencing.operation.transform.AbstractMathTransform
org.apache.sis.referencing.operation.transform.AbstractMathTransform2D
org.apache.sis.referencing.operation.projection.NormalizedProjection
org.apache.sis.referencing.operation.projection.TransverseMercator
org.apache.sis.referencing.operation.projection.TransverseMercator.Spherical
- All Implemented Interfaces:
Serializable
,Parameterized
,LenientComparable
,org.opengis.referencing.operation.MathTransform
,org.opengis.referencing.operation.MathTransform2D
- Enclosing class:
TransverseMercator
Provides the transform equations for the spherical case of the Transverse Mercator projection.
- Since:
- 0.6
- Version:
- 0.6
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.sis.referencing.operation.projection.NormalizedProjection
NormalizedProjection.ParameterRole
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final long
For cross-version compatibility.Fields inherited from class org.apache.sis.referencing.operation.projection.NormalizedProjection
ANGULAR_TOLERANCE, context, eccentricity, eccentricitySquared, ITERATION_TOLERANCE, LARGE_LONGITUDE_LIMIT, MAXIMUM_ITERATIONS, POLAR_AREA_LIMIT
Fields inherited from class org.apache.sis.referencing.operation.transform.AbstractMathTransform2D
DIMENSION
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Spherical
(TransverseMercator other) Constructs a new map projection from the parameters of the given projection. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
inverseTransform
(double[] srcPts, int srcOff, double[] dstPts, int dstOff) Transforms the specified (η, ξ) coordinates and stores the result indstPts
(angles in radians).org.opengis.referencing.operation.Matrix
transform
(double[] srcPts, int srcOff, double[] dstPts, int dstOff, boolean derivate) Projects the specified (λ,φ) coordinates (units in radians) and stores the result indstPts
.Methods inherited from class org.apache.sis.referencing.operation.projection.TransverseMercator
createMapProjection, getDomain
Methods inherited from class org.apache.sis.referencing.operation.projection.NormalizedProjection
completeWithWraparound, computeHashCode, delegate, equals, getContextualParameters, getInternalParameterNames, getInternalParameterValues, getParameterDescriptors, getParameterValues, getWraparoundLongitude, inverse, tryConcatenate, tryConcatenate, variant
Methods inherited from class org.apache.sis.referencing.operation.transform.AbstractMathTransform2D
createTransformedShape, derivative, getSourceDimensions, getTargetDimensions, transform
Methods inherited from class org.apache.sis.referencing.operation.transform.AbstractMathTransform
derivative, equals, formatTo, hashCode, isIdentity, transform, transform, transform, transform, transform
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.operation.MathTransform
derivative, isIdentity, toWKT, transform, transform, transform, transform, transform
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDFor cross-version compatibility.- See Also:
-
-
Constructor Details
-
Spherical
Constructs a new map projection from the parameters of the given projection.- Parameters:
other
- the other projection (usually ellipsoidal) from which to copy the parameters.
-
-
Method Details
-
transform
public org.opengis.referencing.operation.Matrix transform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, boolean derivate) throws ProjectionException Projects the specified (λ,φ) coordinates (units in radians) and stores the result indstPts
. In addition, opportunistically computes the projection derivative ifderivate
istrue
. The results must be multiplied by the denormalization matrix before to get linear distances.Accuracy and domain of validity
Projection errors depend on the difference ∆λ between longitude λ and the central meridian λ₀. All Universal Transverse Mercator (UTM) projections aim for ∆λ ≤ 3°, but this implementation can nevertheless handle larger values. Results have been compared with values provided by Karney, C.F.F. (2009). Test data for the transverse Mercator projection [Data set]. Zenodo. On the WGS84 ellipsoid we observed the following errors compared to Karney's data:- Errors less than 1 centimetre for ∆λ < 60° at all latitudes.
- At latitudes far enough from equator (|φ| ≥ 20°), the domain can be extended up to ∆λ < (1 − ℯ)⋅90° (≈ 82.63627282416406551° on WGS84) with errors less than 70 centimetres.
Case of 82.6…° < ∆λ ≤ 90°
Karney (2009) uses an “extended” domain of transverse Mercator projection for ∆λ ≥ (1 − ℯ)⋅90°, but Apache SIS does not support such extension. Consequently, ∆λ values between (1 − ℯ)⋅90° and 90° should be considered invalid but are not rejected by Apache SIS. Note that those invalid values are consistent with the reverse projection (i.e. applying a projection followed by a reverse projection gives approximately the original values).Rational: those coordinates are accepted despite the low accuracy of projection results because they are sometimes needed for expressing bounding boxes. A bounding box may have corners located in invalid projection area even if all features inside the box have valid coordinates. For "contains" and "intersects" tests between envelopes, we do not need accurate coordinates; a monotonic behavior of x = f(λ) can be sufficient.Case of ∆λ > 90°
Longitude values at a distance greater than 90° from the central meridian are rejected. AProjectionException
is thrown in that case. This limit exists because the Transverse Mercator projection is conceptually a Mercator projection rotated by 90°. Consequently, x values tend toward infinity for ∆λ close to ±90°- Overrides:
transform
in classTransverseMercator
- Parameters:
srcPts
- the array containing the source point coordinates, as (longitude, latitude) angles in radians.srcOff
- the offset of the single coordinate tuple to be converted in the source array.dstPts
- the array into which the converted coordinates is returned (may be the same thansrcPts
). Coordinates will be expressed in a dimensionless unit, as a linear distance on a unit sphere or ellipse.dstOff
- the offset of the location of the converted coordinates that is stored in the destination array.derivate
-true
for computing the derivative, orfalse
if not needed.- Returns:
- the matrix of the projection derivative at the given source position,
or
null
if thederivate
argument isfalse
. - Throws:
ProjectionException
- if the coordinates cannot be converted.- See Also:
-
inverseTransform
protected void inverseTransform(double[] srcPts, int srcOff, double[] dstPts, int dstOff) Transforms the specified (η, ξ) coordinates and stores the result indstPts
(angles in radians).- Overrides:
inverseTransform
in classTransverseMercator
- Parameters:
srcPts
- the array containing the source point coordinates, as linear distance on a unit sphere or ellipse.srcOff
- the offset of the point to be converted in the source array.dstPts
- the array into which the converted point coordinates is returned (may be the same thansrcPts
). Coordinates will be (longitude, latitude) angles in radians.dstOff
- the offset of the location of the converted point that is stored in the destination array.
-