Class ObliqueMercator

  • All Implemented Interfaces:
    Serializable, MathTransform, MathTransform2D
    Direct Known Subclasses:
    HotineObliqueMercator

    public class ObliqueMercator
    extends MapProjection
    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 interseciton 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.

    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
    Since:
    2.1
    Author:
    Gerald I. Evenden (for original code in Proj4), Rueben Schulz
    See Also:
    Oblique Mercator projection on MathWorld, "hotine_oblique_mercator" on RemoteSensing.org, "oblique_mercator" on RemoteSensing.org, Serialized Form
    • Field Detail

      • latitudeOfCentre

        protected final double latitudeOfCentre
        Latitude of the projection centre. This is similar to the MapProjection.latitudeOfOrigin, but the latitude of origin is the Earth equator on aposphere for the oblique mercator.
      • longitudeOfCentre

        protected final double longitudeOfCentre
        Longitude of the projection centre. This is NOT equal to the MapProjection.centralMeridian, which is the meridian where the central line intersects the Earth equator on aposphere.

        This parameter applies to the "azimuth" case only. It is set to NaN for the "two points" case.

      • azimuth

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

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

      • transformNormalized

        protected Point2D transformNormalized​(double x,
                                              double y,
                                              Point2D ptDst)
                                       throws ProjectionException
        Transforms the specified coordinate and stores the result in ptDst. This method is usually (but not guaranteed) to be invoked with values of x in the range [-PI..PI] and values of y in the range [-PI/2..PI/2]. Values outside those ranges are accepted (sometime with a warning logged) on the assumption that most implementations use those values only in trigonometric functions like sin and cos.

        Coordinates have the MapProjection.centralMeridian removed from lambda before this method is invoked. After this method is invoked, the results in ptDst are multiplied by MapProjection.globalScale, and the MapProjection.falseEasting and MapProjection.falseNorthing are added. This means that projections that implement this method are performed on an ellipse (or sphere) with a semi-major axis of 1.

        In PROJ.4, the same standardization, described above, is handled by pj_fwd.c. Therefore when porting projections from PROJ.4, the forward transform equations can be used directly here with minimal change. In the equations of Snyder, MapProjection.falseEasting, MapProjection.falseNorthing and MapProjection.scaleFactor are usually not given. When implementing these equations here, you will not need to remove the MapProjection.centralMeridian from lambda or apply the MapProjection.semiMajor (a or R).

        Specified by:
        transformNormalized in class MapProjection
        Parameters:
        x - The longitude of the coordinate, in radians.
        y - The latitude of the coordinate, in radians.
        ptDst - the specified coordinate point that stores the result of transforming ptSrc, or null. Ordinates will be in a dimensionless unit, as a linear distance on a unit sphere or ellipse.
        Returns:
        the coordinate point after transforming (lambda, phi) and storing the result in ptDst.
        Throws:
        ProjectionException - if the point can't be transformed.
      • inverseTransformNormalized

        protected Point2D inverseTransformNormalized​(double x,
                                                     double y,
                                                     Point2D ptDst)
                                              throws ProjectionException
        Transforms the specified coordinate and stores the result in ptDst. This method returns longitude as x values in the range [-PI..PI] and latitude as y values in the range [-PI/2..PI/2]. It will be checked by the caller, so this method doesn't need to performs this check.

        Input coordinates have the MapProjection.falseEasting and MapProjection.falseNorthing removed and are divided by MapProjection.globalScale before this method is invoked. After this method is invoked, the MapProjection.centralMeridian is added to the x results in ptDst. This means that projections that implement this method are performed on an ellipse (or sphere) with a semi-major axis of 1.

        In PROJ.4, the same standardization, described above, is handled by pj_inv.c. Therefore when porting projections from PROJ.4, the inverse transform equations can be used directly here with minimal change. In the equations of Snyder, MapProjection.falseEasting, MapProjection.falseNorthing and MapProjection.scaleFactor are usually not given. When implementing these equations here, you will not need to add the MapProjection.centralMeridian to the output longitude or remove the MapProjection.semiMajor (a or R).

        Specified by:
        inverseTransformNormalized in class MapProjection
        Parameters:
        x - The easting of the coordinate, linear distance on a unit sphere or ellipse.
        y - The northing of the coordinate, linear distance on a unit sphere or ellipse.
        ptDst - the specified coordinate point that stores the result of transforming ptSrc, or null. Ordinates will be in radians.
        Returns:
        the coordinate point after transforming x, y and storing the result in ptDst.
        Throws:
        ProjectionException - if the point can't be transformed.
      • getToleranceForAssertions

        protected double getToleranceForAssertions​(double longitude,
                                                   double latitude)
        Maximal error (in metres) tolerated for assertion, if enabled.
        Overrides:
        getToleranceForAssertions in class MapProjection
        Parameters:
        longitude - The longitude in decimal degrees.
        latitude - The latitude in decimal degrees.
        Returns:
        The tolerance level for assertions, in meters.
      • hashCode

        public int hashCode()
        Returns a hash value for this projection.
        Overrides:
        hashCode in class MapProjection
      • equals

        public boolean equals​(Object object)
        Compares the specified object with this map projection for equality.
        Overrides:
        equals in class MapProjection
        Parameters:
        object - The object to compare with this transform.
        Returns:
        true if the given object is a transform of the same class and if, given identical source position, the transformed position would be the equals.