Class ObliqueMercator

  • All Implemented Interfaces:
    ICentralMeridianProvider, Proj

    public class ObliqueMercator
    extends AbstractProj
    implements ICentralMeridianProvider
    Oblique Mercator Projection. A conformal, oblique, cylindrical projection with the cylinder touching the ellipsoid (or sphere) along a great circle path (the central line). The Mercator and Transverse Mercator projections can be thought of as special cases of the oblique mercator, where the central line is along the equator or a meridian, respectively. The Oblique Mercator projection has been used in Switzerland, Hungary, Madagascar, Malaysia, Borneo and the panhandle of Alaska.

    The Oblique Mercator projection uses a (U,V) coordinate system, with the U axis along the central line. During the forward projection, coordinates from the ellipsoid are projected conformally to a sphere of constant total curvature, called the "aposphere", before being projected onto the plane. The projection coordinates are further convented to a (X,Y) coordinate system by rotating the calculated (u,v) coordinates to give output (x,y) coordinates. The rotation value is usually the same as the projection azimuth (the angle, east of north, of the central line), but some cases allow a separate rotation parameter.

    There are two forms of the oblique mercator, differing in the origin of their grid coordinates. The Hotine Oblique Mercator (EPSG code 9812) has grid coordinates start at the intersection of the central line and the equator of the aposphere. The Oblique Mercator (EPSG code 9815) is the same, except the grid coordinates begin at the central point (where the latitude of center and central line intersect). ESRI separates these two case by appending "Natural_Origin" (for the "Hotine_Oblique_Mercator") and "Center" (for the "Oblique_Mercator") to the projection names.

    Two different methods are used to specify the central line for the oblique mercator: 1) a central point and an azimuth, east of north, describing the central line and 2) two points on the central line. The EPSG does not use the two point method, while ESRI separates the two cases by putting "Azimuth" and "Two_Point" in their projection names. Both cases use the point where the "latitude_of_center" parameter crosses the central line as the projection's central point. The central meridian is not a projection parameter, and is instead calculated as the intersection between the central line and the equator of the aposphere.

    For the azimuth method, the central latitude cannot be ±90.0 degrees and the central line cannot be at a maximum or minimum latitude at the central point. In the two point method, the latitude of the first and second points cannot be equal. Also, the latitude of the first point and central point cannot be ±90.0 degrees. Furthermore, the latitude of the first point cannot be 0.0 and the latitude of the second point cannot be -90.0 degrees. A change of 10-7 radians can allow calculation at these special cases. Snyder's restriction of the central latitude being 0.0 has been removed, since the equations appear to work correctly in this case.

    Azimuth values of 0.0 and ±90.0 degrees are allowed (and used in Hungary and Switzerland), though these cases would usually use a Mercator or Transverse Mercator projection instead. Azimuth values > 90 degrees cause errors in the equations.

    The oblique mercator is also called the "Rectified Skew Orthomorphic" (RSO). It appears is that the only difference from the oblique mercator is that the RSO allows the rotation from the (U,V) to (X,Y) coordinate system to be different from the azimuth. This separate parameter is called "rectified_grid_angle" (or "XY_Plane_Rotation" by ESRI) and is also included in the EPSG's parameters for the Oblique Mercator and Hotine Oblique Mercator. The rotation parameter is optional in all the non-two point projections and will be set to the azimuth if not specified.

    Projection cases and aliases implemented by the ObliqueMercator are:

    • Oblique_Mercator (EPSG code 9815)
      grid coordinates begin at the central point, has "rectified_grid_angle" parameter.
    • Hotine_Oblique_Mercator_Azimuth_Center (ESRI)
      grid coordinates begin at the central point.
    • Rectified_Skew_Orthomorphic_Center (ESRI)
      grid coordinates begin at the central point, has "rectified_grid_angle" parameter.
    • Hotine_Oblique_Mercator (EPSG code 9812)
      grid coordinates begin at the intersection of the central line and aposphere equator, has "rectified_grid_angle" parameter.
    • Hotine_Oblique_Mercator_Azimuth_Natural_Origin (ESRI)
      grid coordinates begin at the interseciton of the central line and aposphere equator.
    • Rectified_Skew_Orthomorphic_Natural_Origin (ESRI)
      grid coordinates begin at the interseciton of the central line and aposphere equator, has "rectified_grid_angle" parameter.
    • Hotine_Oblique_Mercator_Two_Point_Center (ESRI)
      grid coordinates begin at the central point.
    • Hotine_Oblique_Mercator_Two_Point_Natural_Origin (ESRI)
      grid coordinates begin at the interseciton of the central line and aposphere equator.

    This class has been derived from the implementation of the Geotools project; git 8cbf52d, org.geotools.referencing.operation.projection.ObliqueMercator at the time of migration.

    Note that automatic calculation of bounds is very limited for this projection, since the central line can have any orientation.

    References:

    • libproj4 is available at libproj4 Miscellanea
      Relevent files are: PJ_omerc.c, pj_tsfn.c, pj_fwd.c, pj_inv.c and lib_proj.h
    • John P. Snyder (Map Projections - A Working Manual, U.S. Geological Survey Professional Paper 1395, 1987)
    • "Coordinate Conversions and Transformations including Formulas", EPSG Guidence Note Number 7 part 2, Version 24.
    • Gerald Evenden, 2004, Documentation of revised Oblique Mercator
    See Also:
    Oblique Mercator projection on MathWorld, "hotine_oblique_mercator" on RemoteSensing.org, "oblique_mercator" on RemoteSensing.org
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private double ab
      Convenience value equal to a×b.
      private double arb
      Convenience value equal to a / b.
      protected double azimuth
      The azimuth of the central line passing through the centre of the projection, in radians.
      private double b
      Constants used in the transformation.
      private double bra
      Convenience value equal to b / a.
      protected double centralMeridian
      Central longitude in radians.
      private double cosgamma0
      Sine and Cosine values for gamma0 (the angle between the meridian and central line at the intersection between the central line and the Earth equator on aposphere).
      private double cosrot
      Sine and Cosine values for the rotation between (U,V) and (X,Y) coordinate systems
      private static double EPSILON
      Maximum difference allowed when comparing real numbers.
      private static double EPSILON_LATITUDE
      Maximum difference allowed when comparing latitudes.
      private double g
      Constants used in the transformation.
      protected double rectifiedGridAngle
      The rectified bearing of the central line, in radians.
      private LatLon referencePoint
      A reference point, which is known to be on the central line.
      private double singamma0
      Sine and Cosine values for gamma0 (the angle between the meridian and central line at the intersection between the central line and the Earth equator on aposphere).
      private double sinrot
      Sine and Cosine values for the rotation between (U,V) and (X,Y) coordinate systems
      private double uc
      u value (in (U,V) coordinate system) of the central point.
      private double vPoleN
      v values when the input latitude is a pole.
      private double vPoleS
      v values when the input latitude is a pole.
    • Constructor Summary

      Constructors 
      Constructor Description
      ObliqueMercator()  
    • Field Detail

      • azimuth

        protected double azimuth
        The azimuth of the central line passing through the centre of the projection, in radians.
      • rectifiedGridAngle

        protected double rectifiedGridAngle
        The rectified bearing of the central line, in radians. This is equals to the azimuth if the parameter value is not set.
      • b

        private double b
        Constants used in the transformation.
      • g

        private double g
        Constants used in the transformation.
      • arb

        private double arb
        Convenience value equal to a / b.
      • ab

        private double ab
        Convenience value equal to a×b.
      • bra

        private double bra
        Convenience value equal to b / a.
      • vPoleN

        private double vPoleN
        v values when the input latitude is a pole.
      • vPoleS

        private double vPoleS
        v values when the input latitude is a pole.
      • singamma0

        private double singamma0
        Sine and Cosine values for gamma0 (the angle between the meridian and central line at the intersection between the central line and the Earth equator on aposphere).
      • cosgamma0

        private double cosgamma0
        Sine and Cosine values for gamma0 (the angle between the meridian and central line at the intersection between the central line and the Earth equator on aposphere).
      • sinrot

        private double sinrot
        Sine and Cosine values for the rotation between (U,V) and (X,Y) coordinate systems
      • cosrot

        private double cosrot
        Sine and Cosine values for the rotation between (U,V) and (X,Y) coordinate systems
      • uc

        private double uc
        u value (in (U,V) coordinate system) of the central point. Used in the oblique mercator case. The v value of the central point is 0.0.
      • centralMeridian

        protected double centralMeridian
        Central longitude in radians. Default value is 0, the Greenwich meridian. This is called 'lambda0' in Snyder.
      • referencePoint

        private LatLon referencePoint
        A reference point, which is known to be on the central line.
    • Method Detail

      • getName

        public String getName()
        Description copied from interface: Proj
        Replies a human readable name of this projection.
        Specified by:
        getName in interface Proj
        Returns:
        The projection name. must not be null.
      • getProj4Id

        public String getProj4Id()
        Description copied from interface: Proj
        Replies the Proj.4 identifier.
        Specified by:
        getProj4Id in interface Proj
        Returns:
        The Proj.4 identifier (as reported by cs2cs -lp). If no id exists, return null.
      • project

        public double[] project​(double y,
                                double x)
        Description copied from interface: Proj
        Convert lat/lon to east/north.
        Specified by:
        project in interface Proj
        Parameters:
        y - the latitude in radians
        x - the longitude in radians
        Returns:
        array of length 2, containing east and north value in meters, divided by the semi major axis of the ellipsoid.
      • invproject

        public double[] invproject​(double x,
                                   double y)
        Description copied from interface: Proj
        Convert east/north to lat/lon.
        Specified by:
        invproject in interface Proj
        Parameters:
        x - east value in meters, divided by the semi major axis of the ellipsoid
        y - north value in meters, divided by the semi major axis of the ellipsoid
        Returns:
        array of length 2, containing lat and lon in radians.
      • getAlgorithmBounds

        public Bounds getAlgorithmBounds()
        Description copied from interface: Proj
        Return the bounds where this projection is applicable. This is a fallback for when the projection bounds are not specified explicitly. In this area, the round trip lat/lon -> east/north -> lat/lon should return the starting value with small error. In addition, regions with extreme distortions should be excluded, if possible. It need not be the absolute maximum, but rather an area that is safe to display in JOSM and contain everything that one would expect to use.
        Specified by:
        getAlgorithmBounds in interface Proj
        Returns:
        the bounds where this projection is applicable, null if unknown