| om_get | R Documentation |
Download various OpenStreetMap features to create map layers.
om_get(
x,
r,
download_directory = tempdir(),
force_download = FALSE,
max_file_size = 20,
force_building = FALSE,
quiet = FALSE
)
x |
an sf or sfc object, or a couple of coordinates (lon/lat, EPSG:4326) |
r |
radius of the extraction if x is an sf POINT or a couple of coordinates |
download_directory |
directory to store the file containing raw OpenStreetMap data |
force_download |
if TRUE, the OpenSteetMap file is updated even if it has already been downloaded. |
max_file_size |
the maximum file size to download without asking in interactive mode, in megabytes (default to 20 MB) |
force_building |
force the extraction of buildings in zones larger than 20 km² |
quiet |
if FALSE, the function prints informative messages |
A list of map layers is returned :
zone, the extraction zone;
urban, urban areas;
building, buildings (if the extraction zone area is below 20 km² or
force_building = TRUE);
green, green spaces;
road, main roads;
street, secondary roads;
railway, railways (line);
water, water bodies
If x uses an unprojected CRS (lon/lat, EPSG:4326), ouput uses
Web Mercator CRS (EPSG:3857), it uses x CRS otherwise.
res = om_get(c(-61.070, 14.605), r = 600)
om_map(res, title = "Fort-de-France town centre")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.