Class Projection

java.lang.Object
com.codename1.maps.Projection
Direct Known Subclasses:
Mercator

public abstract class Projection extends Object
This class represents a projection type. a Projection has the ability to translate a WGS84 Coordinate to a projected Coordinate.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Creates a projection to the given bounding box
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the projection bounding box
    Converts a WGS84 bounding box to the projection system bounding box
    abstract Coord
    Converts a given WGS84 coordinate to a projection coordinate
    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
    abstract Coord
    toWGS84(Coord projection)
    Converts a projected coordinate to a WGS84 coordinate

    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

    • Projection

      protected Projection(BoundingBox extent)

      Creates a projection to the given bounding box

      Parameters
      • extent: the bounding box of this projection
  • Method Details

    • extent

      public BoundingBox extent()

      Gets the projection bounding box

      Returns

      bounding box

    • fromWGS84

      public abstract Coord fromWGS84(Coord wgs84)

      Converts a given WGS84 coordinate to a projection coordinate

      Parameters
      • wgs84
    • toWGS84

      public abstract Coord toWGS84(Coord projection)

      Converts a projected coordinate to a WGS84 coordinate

      Parameters
      • projection
    • fromWGS84

      public final Coord[] fromWGS84(Coord[] coords)

      a utility method that converts an array of WGS84 coordinate to the projection coordinates system.

      Parameters
      • coords: an array to converts
      Returns

      a converted array

    • fromWGS84

      public final BoundingBox fromWGS84(BoundingBox bbox)

      Converts a WGS84 bounding box to the projection system bounding box

      Parameters
      • bbox: bounding box too convert
      Returns

      a converted bounding box

    • toWGS84

      public final BoundingBox toWGS84(BoundingBox bbox)

      Converts a projected bounding box to a WGS84 bounding box

      Parameters
      • bbox: bounding box too convert
      Returns

      a converted bounding box