Class TileZXY
- java.lang.Object
-
- org.openstreetmap.josm.data.osm.visitor.paint.TileZXY
-
-
Field Summary
Fields Modifier and Type Field Description private intxprivate intyprivate intzoom-
Fields inherited from interface org.openstreetmap.josm.data.coor.ILatLon
MAX_SERVER_PRECISION
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.util.stream.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 boundsstatic java.util.stream.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 boundsbooleanequals(java.lang.Object obj)inthashCode()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 tilejava.lang.StringtoString()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 level-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.openstreetmap.josm.data.coor.ILatLon
bearing, distanceSq, distanceSq, equalsEpsilon, equalsEpsilon, getEastNorth, greatCircleDistance, interpolate, isLatLonKnown
-
-
-
-
Method Detail
-
zoom
public int zoom()
Get the zoom level- Returns:
- The zoom level for which this tile was created
-
x
public int x()
Get the x coordinate- Returns:
- The x coordinate for this tile
-
y
public int y()
Get the y coordinate- Returns:
- The y coordinate for this tile
-
lat
public double lat()
Get the latitude for upper-left corner of this tile
-
lon
public double lon()
Get the longitude for the upper-left corner of this tile
-
boundsToTiles
public static java.util.stream.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 java.util.stream.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
public static Bounds tileToBounds(TileZXY tile)
Convert a tile to the bounds for that tile- Parameters:
tile- The tile to get the bounds for- Returns:
- The bounds
-
xToLon
public static double xToLon(int x, int zoom)
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
public static double yToLat(int y, int zoom)
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
public static TileZXY latLonToTile(double lat, double lon, int zoom)
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
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-