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 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