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:
- The package is renamed to
osmdata.mobility. - The fork is published from
mobility-team/osmdata.mobility. - File-based Overpass XML input follows the performance change from
ropensci/osmdata#248:fill_overpass_data()reads the XML file directly withreadChar()instead of parsing it and converting it back to text. - The package is listed in the Mobility R-universe registry.
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 publishes osmdata.mobility version 0.2.5.005, based on
upstream osmdata plus the file-based XML read performance change.
This fork follows the upstream osmdata license: GPL-3.