osmdata.mobility is a Mobility-oriented fork of
ropensci/osmdata.
The R package name is osmdata.mobility to avoid confusion with the upstream
CRAN package osmdata. It keeps the original osmdata API; exported functions
such as opq(), add_osm_feature(), osmdata_sf(), and osmdata_xml() are
unchanged.
For the full upstream package presentation, examples, and original OpenStreetMap/Overpass documentation, see the original osmdata README:
https://github.com/ropensci/osmdata#readme
This fork carries Mobility packaging and integration changes for workflows that read downloaded OpenStreetMap XML files repeatedly.
The current changes are:
osmdata.mobility.mobility-team/osmdata.mobility.ropensci/osmdata#248:
fill_overpass_data() reads the XML file directly with readChar() instead
of parsing it and converting it back to text.From Mobility R-universe:
install.packages(
"osmdata.mobility",
repos = c("https://mobility-team.r-universe.dev", "https://cloud.r-project.org")
)
From GitHub:
install.packages("remotes")
remotes::install_github("mobility-team/osmdata.mobility")
library(osmdata.mobility)
q <- opq("Geneva, Switzerland") |>
add_osm_feature(key = "highway")
roads <- osmdata_sf(q)
For Mobility workflows, download OSM XML once and read the saved file directly in later steps:
q <- opq("Geneva, Switzerland") |>
add_osm_feature(key = "highway")
osmdata_xml(q, filename = "geneva-roads.osm")
roads <- osmdata_sf(doc = "geneva-roads.osm")
This fork currently tracks upstream osmdata 0.4.0.9000, plus the
file-based XML read performance change.
This fork follows the upstream osmdata license: GPL-3.