Learn R Programming

slippymath (version 0.3.1)

lonlat_to_tilenum: lonlat_to_tilenum

Description

Convert longitude and latitude to slippy tile numbers

Usage

lonlat_to_tilenum(lon_deg, lat_deg, zoom)

Arguments

lon_deg

degrees longitude for point

lat_deg

degrees latitude for point

zoom

zoom level for tile calculation. Increasing zoom increases the number of tiles.

Value

a list containing `x` and `y` - the tile numbers.

Details

Returns the Open Street Map slippy map tile numbers (x, y) the supplied latitude and longitude fall on, for a given zoom level.

The point specified by lon_deg` and `lat_deg` is assumed to be in ESPG:4326 coordinate reference system.

Examples

Run this code
# NOT RUN {
lonlat_to_tilenum(
 lon = 13.37771496361961,
 lat = 52.51628011262304,
 zoom = 17
)
# }

Run the code above in your browser using DataLab