Class AbstractProj

java.lang.Object
org.openstreetmap.josm.data.projection.proj.AbstractProj
All Implemented Interfaces:
Proj
Direct Known Subclasses:
AlbersEqualArea, AzimuthalEquidistant, CassiniSoldner, DoubleStereographic, EquidistantCylindrical, LambertAzimuthalEqualArea, LambertConformalConic, Mercator, ObliqueMercator, PolarStereographic, Sinusoidal, SwissObliqueMercator, TransverseMercator

public abstract class AbstractProj extends Object implements Proj
Abstract base class providing utilities for implementations of the Proj interface. This class has been derived from the implementation of the Geotools project; git 8cbf52d, org.geotools.referencing.operation.projection.MapProjection at the time of migration.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final double
    Constants used to calculate en0, en1, en2, en3, en4.
    private static final double
     
    private static final double
     
    private static final double
     
    private static final double
     
    private static final double
     
    private static final double
     
    private static final double
     
    private static final double
     
    private static final double
     
    private static final double
     
    private static final double
     
    protected double
    Ellipsoid excentricity, equals to sqrt(excentricity squared).
    protected double
    The square of excentricity: e² = (a²-b²)/a² where e is the excentricity, a is the semi major axis length and b is the semi minor axis length.
    protected double
    Constant needed for the mlfn method.
    protected double
    Constant needed for the mlfn method.
    protected double
    Constant needed for the mlfn method.
    protected double
    Constant needed for the mlfn method.
    protected double
    Constant needed for the mlfn method.
    private static final double
    Difference allowed in iterative computations.
    private static final int
    Maximum number of iterations for iterative computations.
    private static final double
    Relative iteration precision used in the mlfn method
    protected boolean
    is ellipsoid spherical?
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected final double
    aasin(double v)
    Tolerant asin that will just return the limits of its output range if the input is out of range
    (package private) final double
    cphi2(double ts)
     
    void
    Initialize the projection using the provided parameters.
    protected final double
    invMlfn(double arg)
    Calculates the latitude (phi) from a meridian distance.
    boolean
    Return true, if a geographic coordinate reference system is represented.
    protected final double
    mlfn(double phi, double sphi, double cphi)
    Calculates the meridian distance.
    (package private) final double
    msfn(double s, double c)
    Computes function f(s,c,e²) = c/sqrt(1 - s²×e²) needed for the true scale latitude (Snyder 14-15), where s and c are the sine and cosine of the true scale latitude, and e² is the eccentricity squared.
    (package private) final double
    tsfn(double lat, double sinlat)
    Computes function (15-9) and (9-13) from Snyder.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.openstreetmap.josm.data.projection.proj.Proj

    getAlgorithmBounds, getName, getProj4Id, invproject, lonIsLinearToEast, project
  • Field Details

  • Constructor Details

  • Method Details

    • initialize

      Description copied from interface: Proj
      Initialize the projection using the provided parameters.
      Specified by:
      initialize in interface Proj
      Parameters:
      params - The projection parameters
      Throws:
      ProjectionConfigurationException - in case parameters are not suitable
    • isGeographic

      public boolean isGeographic()
      Description copied from interface: Proj
      Return true, if a geographic coordinate reference system is represented. I.e. if it returns latitude/longitude values rather than Cartesian east/north coordinates on a flat surface.
      Specified by:
      isGeographic in interface Proj
      Returns:
      true, if it is geographic
    • mlfn

      protected final double mlfn(double phi, double sphi, double cphi)
      Calculates the meridian distance. This is the distance along the central meridian from the equator to phi. Accurate to < 1e-5 meters when used in conjunction with typical major axis values.
      Parameters:
      phi - latitude to calculate meridian distance for.
      sphi - sin(phi).
      cphi - cos(phi).
      Returns:
      meridian distance for the given latitude.
    • invMlfn

      protected final double invMlfn(double arg)
      Calculates the latitude (phi) from a meridian distance. Determines phi to TOL (1e-11) radians, about 1e-6 seconds.
      Parameters:
      arg - meridian distance to calculate latitude for.
      Returns:
      the latitude of the meridian distance.
      Throws:
      RuntimeException - if the itteration does not converge.
    • aasin

      protected final double aasin(double v)
      Tolerant asin that will just return the limits of its output range if the input is out of range
      Parameters:
      v - the value whose arc sine is to be returned.
      Returns:
      the arc sine of the argument.
    • cphi2

      final double cphi2(double ts)
    • msfn

      final double msfn(double s, double c)
      Computes function f(s,c,e²) = c/sqrt(1 - s²×e²) needed for the true scale latitude (Snyder 14-15), where s and c are the sine and cosine of the true scale latitude, and e² is the eccentricity squared.
      Parameters:
      s - sine of the true scale latitude
      c - cosine of the true scale latitude
      Returns:
      c/sqrt(1 - s²×e²)
    • tsfn

      final double tsfn(double lat, double sinlat)
      Computes function (15-9) and (9-13) from Snyder. Equivalent to negative of function (7-7).
      Parameters:
      lat - the latitude
      sinlat - sine of the latitude
      Returns:
      auxiliary value computed from lat and sinlat