Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

LonLat2XY

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@gmail.com, based on function LatLon2XY by Markus Loecher, Sense Networks markus@sensenetworks.com in package RgoogleMaps

See Also

Examples

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


## End(Not run)

ggmap

Spatial Visualization with ggplot2

v3.0.0
GPL-2
Authors
David Kahle [aut, cre] (<https://orcid.org/0000-0002-9999-1558>), Hadley Wickham [aut] (<https://orcid.org/0000-0003-4757-117X>), Scott Jackson [aut], Mikko Korpela [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.