powered by
Convert a tile coordinate to a lon/lat coordinate for a given zoom. Decimal tile coordinates are accepted.
XY2LonLat(X, Y, zoom, x = 0, y = 0, xpix = 255, ypix = 255)
a data frame with columns lon and lat (in degrees)
horizontal map-tile coordinate (0 is map-left)
vertical map-tile coordinate (0 is map-top)
zoom
within tile x (0 is tile-left)
within tile y (0 it tile-top)
width of tile in pixels
length of tile in pixels
David Kahle david@kahle.io, based on RgoogleMaps::XY2LatLon() by Markus Loecher of Sense Networks markus@sensenetworks.com
RgoogleMaps::XY2LatLon()
https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames
if (FALSE) { XY2LonLat(480, 845, zoom = 11) XY2LonLat(0, 0, zoom = 1) XY2LonLat(0, 0, 255, 255, zoom = 1) XY2LonLat(0, 0, 255, 255, zoom = 1) }
Run the code above in your browser using DataLab