lonlat2bbox | R Documentation |
Bounding box from lon and lat values
lonlat2bbox(lon, lat, width = NULL, dist = NULL, units = "kilometers", method = "sp_rgeos", ...)
lon |
(numeric) longitude |
lat |
(numeric) latitude |
width |
(numeric) width, passed on to [rgeos::gBuffer()], see it's docs for more info. units are metric, so 10 is 10 m, 1000 is 1000 m, etc. |
dist |
(numeric) distance. passed on to [lawn::lawn_buffer()] |
units |
(character) units. passed on to [lawn::lawn_buffer()]. Default: kilometers |
method |
(character) which method to use, either combination of sp and rgeos ("sp_rgeos") or lawn |
... |
additional parameters passed on to [rgeos::gBuffer()] |
bounding box numeric values in the order '[minX, minY, maxX, maxY]'
# 10m lonlat2bbox(lon=-120, lat=45, width=10) # 100m lonlat2bbox(-120, 45, 100) # 1000m, or 1 km lonlat2bbox(-120, 45, 1000) # 10 km lonlat2bbox(-120, 45, 10^4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.