public abstract class TileIdentifier extends Object
For example, OpenStreetMap identifies the tile by z/x/y.png; Bing Maps uses a quad key
representation.
This class formerly known as "WMTTileName".
Constructor and Description |
---|
TileIdentifier(int x,
int y,
ZoomLevel zoomLevel,
String serviceName) |
Modifier and Type | Method and Description |
---|---|
static int |
arithmeticMod(int a,
int b)
Arithmetic implementation of modulo, as the Java implementation of modulo can return negative
values.
|
boolean |
equals(Object other) |
abstract String |
getCode()
Gets the code of a tile.
|
abstract String |
getId()
Gets the id of a tile, which can be used for caching purposes.
|
abstract TileIdentifier |
getLowerNeighbour() |
abstract TileIdentifier |
getRightNeighbour() |
String |
getServiceName() |
int |
getX()
Gets the column value of a tile.
|
int |
getY()
Gets the row value of a tile.
|
int |
getZ()
Gets the zoom level (aka "level of detail").
|
ZoomLevel |
getZoomLevel()
Gets the row value of a tile.
|
int |
hashCode() |
String |
toString() |
public int getZ()
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
public int getX()
public int getY()
public ZoomLevel getZoomLevel()
public String getServiceName()
public static final int arithmeticMod(int a, int b)
arithmeticMod(-1, 8) = 7
a
- b
- public abstract String getId()
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").
public abstract String getCode()
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).
public abstract TileIdentifier getRightNeighbour()
public abstract TileIdentifier getLowerNeighbour()
Copyright © 1996–2019 Geotools. All rights reserved.