org.gicentre.utils.spatial

## Class ObliqueMercator

- java.lang.Object
- - org.gicentre.utils.spatial.ObliqueMercator

- All Implemented Interfaces:
    MapProjection

      public class ObliqueMercator
      extends java.lang.Object
      implements MapProjection

  Class for representing Oblique Mercator projections. Includes forward and inverse transforms from and to longitude/latitude. Uses transformation equations from Snyder (1987) Atlas of Map Projections summarised at this Hotine Oblique Mercator page.
  Version:
    3.4, 5th February, 2016.
  Author:
    Jo Wood, giCentre, City University London.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `FROM_LAT_LONG` Indicates a transformation from longitude/latitude
    `static int` | `TO_LAT_LONG` Indicates a transformation to longitude/latitude

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ObliqueMercator(Ellipsoid ellipsoid)` Initialises the Oblique Mercator converter with the given ellipsoid.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `doInterpolation()` Indicates whether the transformation should use nearest neighbour (false) or some interpolator (true).
    `java.lang.String` | `getDescription()` Provides a general description of the transformation.
    `Ellipsoid` | `getEllipsoid()` Reports the ellipsoid used in the transformation.
    `processing.core.PVector` | `invTransformCoords(processing.core.PVector p)` Performs an inverse Oblique Mercator to lat/long transform on the given location.
    `processing.core.PVector` | `latLongToObliqueMercator(processing.core.PVector p)` Converts the given (`lat`,`lng`) coordinates into an oblique Mercator location.
    `processing.core.PVector` | `obliqueMercatorToLatLong(processing.core.PVector p)` Converts the given Oblique Mercator coordinates into a longitude/latitude location.
    `void` | `setInterpolation(boolean doInterpolation)` Sets whether the transformation should use nearest neighbour (false) or some interpolator (true).
    `processing.core.PVector` | `transformCoords(processing.core.PVector p)` Performs a forward longitude/latitude to Oblique Mercator transform on the given location.

    - ### Methods inherited from class java.lang.Object

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

- - ### Field Detail

    - #### FROM_LAT_LONG

          public static final int FROM_LAT_LONG

      Indicates a transformation from longitude/latitude
      See Also:
        Constant Field Values

    - #### TO_LAT_LONG

          public static final int TO_LAT_LONG

      Indicates a transformation to longitude/latitude
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### ObliqueMercator

          public ObliqueMercator(Ellipsoid ellipsoid)

      Initialises the Oblique Mercator converter with the given ellipsoid. The forward transformation will be from Lat/long to Oblique Merctor.
      Parameters:
        `ellipsoid` - to use in projection.

  - ### Method Detail

    - #### transformCoords

          public processing.core.PVector transformCoords(processing.core.PVector p)

      Performs a forward longitude/latitude to Oblique Mercator transform on the given location.
      Specified by:
        `transformCoords` in interface `MapProjection`
      Parameters:
        `p` - point coordinates to transform.
      Returns:
        Transformed footprint.

    - #### invTransformCoords

          public processing.core.PVector invTransformCoords(processing.core.PVector p)

      Performs an inverse Oblique Mercator to lat/long transform on the given location.
      Specified by:
        `invTransformCoords` in interface `MapProjection`
      Parameters:
        `p` - Point coordinates to transform
      Returns:
        Transformed footprint.

    - #### getDescription

          public java.lang.String getDescription()

      Provides a general description of the transformation.
      Specified by:
        `getDescription` in interface `MapProjection`
      Returns:
        Description of the transformation.

    - #### doInterpolation

          public boolean doInterpolation()

      Indicates whether the transformation should use nearest neighbour (false) or some interpolator (true).
      Returns:
        True if transformation should perform some local interpolation.

    - #### setInterpolation

          public void setInterpolation(boolean doInterpolation)

      Sets whether the transformation should use nearest neighbour (false) or some interpolator (true).
      Parameters:
        `doInterpolation` - True if transformation should perform some local interpolation.

    - #### latLongToObliqueMercator

          public processing.core.PVector latLongToObliqueMercator(processing.core.PVector p)

      Converts the given (`lat`,`lng`) coordinates into an oblique Mercator location. Longitude/latitude should be in decimal degrees with positive North and positive East.
      Parameters:
        `p` - Longitude/latitude point. Longitude varies within +-180 degrees, latitude within +-90 degrees.
      Returns:
        Oblique Mercator location.

    - #### obliqueMercatorToLatLong

          public processing.core.PVector obliqueMercatorToLatLong(processing.core.PVector p)

      Converts the given Oblique Mercator coordinates into a longitude/latitude location. Longitude/latitude will be in decimal degrees with positive North and negative East.
      Parameters:
        `p` - Location of point as an easting and northing in the Oblique Mercator projection (metres from local origin).
      Returns:
        Longitude/latitude location.

    - #### getEllipsoid

          public Ellipsoid getEllipsoid()

      Reports the ellipsoid used in the transformation.
      Returns:
        Ellipsoid used in the Oblique Mercator transformation.