ox_read | R Documentation |
Read OSM XML files, sometimes obtained from the "Export" page on
openstreetmap.org. Internally, uses the sf::st_read()
function, which
itself use GDAL's OSM driver: https://gdal.org/drivers/vector/osm.html
ox_read(path, expand_tags = TRUE)
path |
Path to .osm file (string) |
expand_tags |
Should the "other_tags" column be expanded into single-tag columns? (logical; default is TRUE) |
An object of class "osm". There are print
and plot
methods for this class.
According to GDAL, the object is made of:
points: “node” features that have significant tags attached
lines: “way” features that are not recognised as areas
multilinestrings: “relation” features that form a multilinestring (type = ‘multilinestring’ or type = ‘route’)
multipolygons: “relation” features that form a multipolygon (type = ‘multipolygon’ or type = ‘boundary’), and “way” features that are recognised as areas
other_relations: “relation” features that do not belong to either multilinestrings or multipolygons
# read example South Brisbane .osm file sb <- ox_read( system.file("extdata/south_brisbane.osm", package = "osmxml"), expand_tags = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.