ox_download | R Documentation |
Download an OSM export by specifying its bounding box, or find a local cached equivalent. The osmxml package does not further make use of the OSM API, given that it is mainly intended to be used for editing purposes, as explained on the API Usage Policy website: https://operations.osmfoundation.org/policies/api/. This function only mimics the existing https://www.openstreetmap.org "Export" functionality to save the user manually downloading the file from the website.
ox_download(bbox, destfile = NULL, use_cached = TRUE)
bbox |
bounding box of area to download, determined by a numeric vector of four values: Western longitude, Southern latitude, Eastern longitude, Northern latitude (in this order) |
destfile |
path to download the file to. Defaults to a filename that includes the bbox values so it can be used as cached data (in the current working directory). |
use_cached |
should the function look for a matching cached file? Logical, default is TRUE. |
The path is returned so it can easily be piped into the
ox_read
function
All data downloaded with this function is © OpenStreetMap contributors, and the conditions of its reuse are defined by the ODbL licence. You likely need to include this information on anything derived from it. Find out more on the OSM website: https://www.openstreetmap.org/copyright
## Not run: # Download and read area around Te Kura Tatauranga, Waipapa Taumata Rau TKT <- c(174.76598, -36.85440, 174.77019, -36.85129) |> ox_download() |> ox_read() ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.