Class QuadTiling

java.lang.Object
org.openstreetmap.josm.data.coor.QuadTiling

public final class QuadTiling extends Object
This class helps in tiling the world into multiple quad tiles.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    The maximum number of levels to split the quads
    static final int
    How many tiles there are per level
    static final int
    The log(2) of how many tiles there are per level
    static final double
    The number of parts the world is split into in each direction
    static final int
    The offset of the world in x direction
    static final int
    The size of the world in X direction
    static final int
    The offset of the world in y direction
    static final int
    The size of the world in y direction
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static byte
    index(double lat, double lon, int level)
    Returns quad tiling index for given coordinates and level.
    (package private) static long
    lat2y(double lat)
     
    (package private) static long
    lon2x(double lon)
     
    static LatLon
    tile2LatLon(long quad)
    Converts a tile index to a lat/lon position

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • tile2LatLon

      public static LatLon tile2LatLon(long quad)
      Converts a tile index to a lat/lon position
      Parameters:
      quad - The tile to convert
      Returns:
      The lat/lon position of that tile
    • lon2x

      static long lon2x(double lon)
    • lat2y

      static long lat2y(double lat)
    • index

      public static byte index(double lat, double lon, int level)
      Returns quad tiling index for given coordinates and level.
      Parameters:
      lat - latitude
      lon - longitude
      level - level
      Returns:
      quad tiling index for given coordinates and level.
      Since:
      6171