LonLat2XY: Convert a lon/lat coordinate to a tile coordinate

View source: R/LonLat2XY.R

LonLat2XYR Documentation

Convert a lon/lat coordinate to a tile coordinate

Description

Convert a lon/lat coordinate to a tile coordinate for a given zoom. Decimal tile coordinates (x, y) are reported.

Usage

LonLat2XY(lon_deg, lat_deg, zoom, xpix = 256, ypix = 256)

Arguments

lon_deg

longitude in degrees

lat_deg

latitude in degrees

zoom

zoom

xpix

width of tile in pixels

ypix

length of tile in pixels

Value

a data frame with columns X, Y, x, y

Author(s)

David Kahle david@kahle.io, based on RgoogleMaps::LatLon2XY() by Markus Loecher of Sense Networks markus@sensenetworks.com

See Also

https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames

Examples



## Not run: 
gc <- geocode('baylor university')
LonLat2XY(gc$lon, gc$lat, 10)


## End(Not run)


dkahle/ggmap documentation built on March 3, 2024, 8:19 a.m.