Class TileIdentifier
- Direct Known Subclasses:
BingTileIdentifier,OSMTileIdentifier
For example, OpenStreetMap identifies the tile by z/x/y.png; Bing Maps uses a quad key representation.
This class formerly known as "WMTTileName".
- Since:
- 12
- Author:
- Tobias Sauerwein, Ugo Taddei
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final intarithmeticMod(int a, int b) Arithmetic implementation of modulo, as the Java implementation of modulo can return negative values.booleanabstract StringgetCode()Gets the code of a tile.abstract StringgetId()Gets the id of a tile, which can be used for caching purposes.abstract TileIdentifierabstract TileIdentifierintgetX()Gets the column value of a tile.intgetY()Gets the row value of a tile.intgetZ()Gets the zoom level (aka "level of detail").Gets the row value of a tile.inthashCode()toString()
-
Constructor Details
-
TileIdentifier
-
-
Method Details
-
getZ
public int getZ()Gets the zoom level (aka "level of detail").Most tile services offer zoom level in the range between 0 (whole world) to 22 (street level). The exact range depends on the service implementation
- Returns:
- the zoom level
-
getX
public int getX()Gets the column value of a tile. -
getY
public int getY()Gets the row value of a tile. -
getZoomLevel
Gets the row value of a tile. -
getServiceName
-
arithmeticMod
public static final int arithmeticMod(int a, int b) Arithmetic implementation of modulo, as the Java implementation of modulo can return negative values.arithmeticMod(-1, 8) = 7
- Returns:
- the positive remainder
-
equals
-
hashCode
public int hashCode() -
toString
-
getId
Gets the id of a tile, which can be used for caching purposes.The id is a file-friendly name (that is, should contains no special characters such as ".", "/", etc. The id should be build from the code (which also uniquely identifies a tile, but, in some service implementation may contain file-unfriendly characters (e.g. OpenStreetMap: 5/16/10.png).
When building an id, you should use the service name as a prefix (e.g. for OpenStreetMap: "Mapnik", "CycleMap"; Bing Maps: "Road", "Hybrid"; etc) and suffix the id with a file-friendly string (e.g. OpenStreetMap: "Mapnik_X_Y_Z").
-
getCode
Gets the code of a tile.The id is a string which uniquely identifies a tile. In some service implementations this is a quadkey (e.g. Bing Maps: "03123") or the fragment of the tile image (e.g. OpenStreetMap: 5/16/10.png, for Z/X/Y.png).
- Returns:
- the code
-
getRightNeighbour
-
getLowerNeighbour
-