Class Mercator

java.lang.Object
com.codename1.maps.Projection
com.codename1.maps.Mercator

public class Mercator extends Projection
Represents a Mercator projection http://en.wikipedia.org/wiki/Mercator_projection
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new Mercator projection
  • Method Summary

    Modifier and Type
    Method
    Description
    static Coord
    forwardMercator(double latitude, double longitude)
    Create a projected Mercator Coord from the given coordinate
    Create a projected Mercator Coord from the given coordinate
    static Coord
    inverseMercator(double latitude, double longitude)
    Create a unprojected Coord(Latitude, Longitude) from the projected Coord
    toWGS84(Coord projection)
    Create a Coord(Latitude, Longitude) from the projected Coord

    Methods inherited from class Projection

    extent, fromWGS84, fromWGS84, toWGS84
    Modifier and Type
    Method
    Description
    Gets the projection bounding box
    Converts a WGS84 bounding box to the projection system bounding box
    final Coord[]
    fromWGS84(Coord[] coords)
    a utility method that converts an array of WGS84 coordinate to the projection coordinates system.
    Converts a projected bounding box to a WGS84 bounding box

    Methods inherited from class Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    Modifier and Type
    Method
    Description
    protected Object
     
    boolean
    Indicates whether some other object is "equal to" this one.
    final Class
    Returns the runtime class of an object.
    int
    Returns a hash code value for the object.
    final void
    Wakes up a single thread that is waiting on this object's monitor.
    final void
    Wakes up all threads that are waiting on this object's monitor.
    Returns a string representation of the object.
    final void
    Causes current thread to wait until another thread invokes the method or the method for this object.
    final void
    wait(long timeout)
    Causes current thread to wait until either another thread invokes the method or the method for this object, or a specified amount of time has elapsed.
    final void
    wait(long timeout, int nanos)
    Causes current thread to wait until another thread invokes the method or the method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
  • Constructor Details

    • Mercator

      public Mercator()
      Creates a new Mercator projection
  • Method Details

    • forwardMercator

      public static Coord forwardMercator(double latitude, double longitude)

      Create a projected Mercator Coord from the given coordinate

      Parameters
      • latitude: to project

      • longitude: to project

      Returns

      a projected Mercator

    • inverseMercator

      public static Coord inverseMercator(double latitude, double longitude)

      Create a unprojected Coord(Latitude, Longitude) from the projected Coord

      Parameters
      • latitude: projected latitude

      • longitude: projected longitude

      Returns

      unprojected Coord

    • fromWGS84

      public Coord fromWGS84(Coord wgs84)

      Create a projected Mercator Coord from the given coordinate

      Parameters
      • wgs84: coordinate to project
      Returns

      projected Mercator Coord

      Specified by:
      fromWGS84 in class Projection
    • toWGS84

      public Coord toWGS84(Coord projection)

      Create a Coord(Latitude, Longitude) from the projected Coord

      Parameters
      • wgs84: projected Coord
      Returns

      unprojected Latitude, Longitude

      Specified by:
      toWGS84 in class Projection