Class TileZXY
java.lang.Object
org.openstreetmap.josm.data.osm.visitor.paint.TileZXY
- All Implemented Interfaces:
ILatLon
A record used for storing tile information for painting.
The origin is upper-left, not lower-left (so more like Google tile coordinates than TMS tile coordinates).
- Since:
- 19176
-
Field Summary
FieldsFields inherited from interface org.openstreetmap.josm.data.coor.ILatLon
MAX_SERVER_PRECISION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboundsToTiles(double minLat, double minLon, double maxLat, double maxLon, int zoom) Convert a bounds to a series of tiles that entirely cover the boundsboundsToTiles(double minLat, double minLon, double maxLat, double maxLon, int zoom, int expansion) Convert a bounds to a series of tiles that entirely cover the boundsbooleaninthashCode()doublelat()Get the latitude for upper-left corner of this tilestatic TileZXYlatLonToTile(double lat, double lon, int zoom) Convert a lat, lon, and zoom to a tile coordiantedoublelon()Get the longitude for the upper-left corner of this tilestatic BoundstileToBounds(TileZXY tile) Convert a tile to the bounds for that tiletoString()intx()Get the x coordinatestatic doublexToLon(int x, int zoom) Convert a x tile coordinate to a latitudeinty()Get the y coordinatestatic doubleyToLat(int y, int zoom) Convert a y tile coordinate to a latitudeintzoom()Get the zoom levelMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.openstreetmap.josm.data.coor.ILatLon
bearing, distanceSq, distanceSq, equalsEpsilon, equalsEpsilon, getEastNorth, greatCircleDistance, interpolate, isLatLonKnown
-
Field Details
-
zoom
-
x
-
y
-
-
Constructor Details
-
TileZXY
Create a newTileZXYobject- Parameters:
zoom- The zoom for which this tile was createdx- The x coordinate at the specified zoom levely- The y coordinate at the specified zoom level
-
-
Method Details
-
zoom
Get the zoom level- Returns:
- The zoom level for which this tile was created
-
x
Get the x coordinate- Returns:
- The x coordinate for this tile
-
y
Get the y coordinate- Returns:
- The y coordinate for this tile
-
lat
Get the latitude for upper-left corner of this tile -
lon
Get the longitude for the upper-left corner of this tile -
boundsToTiles
public static Stream<TileZXY> boundsToTiles(double minLat, double minLon, double maxLat, double maxLon, int zoom) Convert a bounds to a series of tiles that entirely cover the bounds- Parameters:
minLat- The minimum latitudeminLon- The minimum longitudemaxLat- The maximum latitudemaxLon- The maximum longitudezoom- The zoom level to generate the tiles for- Returns:
- The stream of tiles
-
boundsToTiles
public static Stream<TileZXY> boundsToTiles(double minLat, double minLon, double maxLat, double maxLon, int zoom, int expansion) Convert a bounds to a series of tiles that entirely cover the bounds- Parameters:
minLat- The minimum latitudeminLon- The minimum longitudemaxLat- The maximum latitudemaxLon- The maximum longitudezoom- The zoom level to generate the tiles forexpansion- The number of tiles to expand on the x/y axis (1 row north, 1 row south, 1 column left, 1 column right)- Returns:
- The stream of tiles
-
tileToBounds
Convert a tile to the bounds for that tile- Parameters:
tile- The tile to get the bounds for- Returns:
- The bounds
-
xToLon
Convert a x tile coordinate to a latitude- Parameters:
x- The x coordinatezoom- The zoom level to use for the calculation- Returns:
- The latitude for the x coordinate (upper-left of the tile)
-
yToLat
Convert a y tile coordinate to a latitude- Parameters:
y- The y coordinatezoom- The zoom level to use for the calculation- Returns:
- The latitude for the y coordinate (upper-left of the tile)
-
latLonToTile
Convert a lat, lon, and zoom to a tile coordiante- Parameters:
lat- The latitudelon- The longitudezoom- The zoom level- Returns:
- The specified tile coordinates at the specified zoom
-
toString
-
hashCode
-
equals
-