@Api(allMethods=true) public class TileCode extends Object implements Serializable, CacheableObject
A unique spatial code determining the location of a tile. It implements the Serializable interface as it
is often used as a data transfer object.
Tiling mechanisms are usually build in several levels, where the top level has only one tile, and for each level that you go deeper, the number of tiles doubles in both the X and the Y directions. All 3 parameters (tileLevel, X and Y) must always be positive integers.
Note that at a certain tile level, X and Y must always be a value between 0 and (2^tileLevel) - 1. For
example:
| Constructor and Description |
|---|
TileCode()
Default constructor.
|
TileCode(int tileLevel,
int x,
int y)
The only constructor available.
|
| Modifier and Type | Method and Description |
|---|---|
TileCode |
clone()
Create a clone from this object.
|
boolean |
equals(Object o)
Are the two objects equal?
|
String |
getCacheId()
String identifier which is guaranteed to include sufficient information to assure to be different for two
instances which could produce different result.
|
int |
getTileLevel()
Get the tiling depth level.
|
int |
getX()
Get the X-ordinate at the given level: X=[0, (2^tileLevel) - 1].
|
int |
getY()
Get the Y-ordinate at the given level: Y=[0, (2^tileLevel) - 1].
|
int |
hashCode()
Calculate object hash code.
|
void |
setTileLevel(int tileLevel)
set the tiling depth level.
|
void |
setX(int x)
The X-ordinate at the given level: X=[0, (2^tileLevel) - 1].
|
void |
setY(int y)
The Y-ordinate at the given level: Y=[0, (2^tileLevel) - 1].
|
String |
toString()
Return the values as a readable text:
TileLevel-X-Y. |
public TileCode()
public TileCode(int tileLevel,
int x,
int y)
tileLevel - The tiling depth level. Where 0 means the top level. Make sure this is always a positive integer!x - The X-ordinate at the given level: X=[0, (2^tileLevel) - 1].y - The Y-ordinate at the given level: Y=[0, (2^tileLevel) - 1].public TileCode clone()
public String toString()
TileLevel-X-Y.public int getTileLevel()
public void setTileLevel(int tileLevel)
tileLevel - The new value.public int getX()
public void setX(int x)
x - The new value.public int getY()
public void setY(int y)
y - The new value.public String getCacheId()
getCacheId in interface CacheableObjectpublic boolean equals(Object o)
Copyright © 2015 Geosparc. All Rights Reserved.