Convert a lon/lat coordinate to a tile coordinate
Convert a lon/lat coordinate to a tile coordinate for a given zoom. Decimal tile coordinates (x, y) are reported.
LonLat2XY(lon_deg, lat_deg, zoom, xpix = 256, ypix = 256)
lon_deg
: longitude in degreeslat_deg
: latitude in degreeszoom
: zoomxpix
: width of tile in pixelsypix
: length of tile in pixelsa data frame with columns X, Y, x, y
## Not run: gc <- geocode('baylor university') LonLat2XY(gc$lon, gc$lat, 10) ## End(Not run)
https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames
David Kahle david@kahle.io , based on RgoogleMaps::LatLon2XY()
by Markus Loecher of Sense Networks markus@sensenetworks.com