Class TransverseMercator.Spherical

All Implemented Interfaces:
Serializable, Parameterized, LenientComparable, org.opengis.referencing.operation.MathTransform, org.opengis.referencing.operation.MathTransform2D
Enclosing class:
TransverseMercator

private static final class TransverseMercator.Spherical extends TransverseMercator
Provides the transform equations for the spherical case of the Transverse Mercator projection.
Since:
0.6
Version:
0.6
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      For cross-version compatibility.
      See Also:
  • Constructor Details

    • Spherical

      protected Spherical(TransverseMercator other)
      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 in dstPts. In addition, opportunistically computes the projection derivative if derivate is true. 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. A ProjectionException 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 class TransverseMercator
      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 than srcPts). 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, or false if not needed.
      Returns:
      the matrix of the projection derivative at the given source position, or null if the derivate argument is false.
      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 in dstPts (angles in radians).
      Overrides:
      inverseTransform in class TransverseMercator
      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 than srcPts). 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.