Package org.openstreetmap.josm.data.coor
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 int
NR_LEVELS
The maximum number of levels to split the quadsstatic int
TILES_PER_LEVEL
How many tiles there are per levelstatic int
TILES_PER_LEVEL_SHIFT
The log(2) of how many tiles there are per levelstatic double
WORLD_PARTS
The number of parts the world is split into in each directionstatic int
X_BIAS
The offset of the world in x directionstatic int
X_PARTS
The size of the world in X directionstatic int
Y_BIAS
The offset of the world in y directionstatic int
Y_PARTS
The size of the world in y direction
-
Constructor Summary
Constructors Modifier Constructor Description private
QuadTiling()
-
Method Summary
All Methods Static Methods Concrete Methods 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
-
-
-
Field Detail
-
NR_LEVELS
public static final int NR_LEVELS
The maximum number of levels to split the quads- See Also:
- Constant Field Values
-
WORLD_PARTS
public static final double WORLD_PARTS
The number of parts the world is split into in each direction- See Also:
- Constant Field Values
-
TILES_PER_LEVEL_SHIFT
public static final int TILES_PER_LEVEL_SHIFT
The log(2) of how many tiles there are per level- See Also:
- Constant Field Values
-
TILES_PER_LEVEL
public static final int TILES_PER_LEVEL
How many tiles there are per level- See Also:
- Constant Field Values
-
X_PARTS
public static final int X_PARTS
The size of the world in X direction- See Also:
- Constant Field Values
-
X_BIAS
public static final int X_BIAS
The offset of the world in x direction- See Also:
- Constant Field Values
-
Y_PARTS
public static final int Y_PARTS
The size of the world in y direction- See Also:
- Constant Field Values
-
Y_BIAS
public static final int Y_BIAS
The offset of the world in y direction- See Also:
- Constant Field Values
-
-
Constructor Detail
-
QuadTiling
private QuadTiling()
-
-
Method Detail
-
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
- latitudelon
- longitudelevel
- level- Returns:
- quad tiling index for given coordinates and level.
- Since:
- 6171
-
-