← Back to all sparks
O

osmextract

ANALYTICS
Velocity0.0

Download and import OpenStreetMap data from Geofabrik and other providers

osmextract stopped throwing your OpenStreetMap downloads away at the end of every session.

openstreetmapgeospatialr-languagegdalrouting
Current state
osmextract downloads OpenStreetMap extracts from Geofabrik, BBBike and openstreetmap.fr and translates them into sf objects via GDAL. The 0.6.0 release moved its download cache from `tempdir()` to a persistent `tools::R_user_dir()` location and raised the R floor to 4.1.0 to get it. It also made spatial `place` inputs self-clipping: pass an sf or bbox object and the boundary is now set to match, so only the relevant slice of a country-sized extract is processed.
Where it's heading
Two threads run through every release. One is chasing GDAL — SQL syntax adjusted for 3.10, ogr2ogr options fixed for 3.9, and an `osmconf.ini` that 0.6.0 finally keeps automatically in sync with whatever sf or GDAL provides rather than shipping a snapshot. The other is the road-network extraction added experimentally in 0.3.1, which has been quietly accumulating real routing semantics since: `access = no` links retained when the mode-specific tag permits them, a `oneway` column by default for driving, and `motor_vehicle` always included.
Prediction
Given that `oe_get_network()` has gained transport-mode detail in three separate releases while remaining flagged as experimental, the next substantive work is most likely there — either more modes or a formal exit from experimental status.

Recent moves

  1. 4mo ago

    Downloads move to a persistent cache outside tempdir

    ⚡ SPARK

    The release that changes the package's data lifecycle rather than its feature list: extracts now live in a persistent user directory instead of being discarded with the session. Paired with automatic boundary clipping for spatial inputs and an `osmconf.ini` that tracks GDAL, it removes the two biggest sources of repeated work.

    View source ↗
  2. 1y ago

    oe_match gains a version argument for historical extracts

    A `version` argument on `oe_match()` for pulling older Geofabrik extracts. Narrow, but it is the difference between reproducible analysis and analysis pinned to whatever the provider served that day.

    View source ↗
  3. 1y ago

    Routing semantics sharpen for driving and restricted-access links

    Network extraction gets closer to what routing actually needs: links tagged `access = no` are kept when the mode-specific key permits them, driving networks always carry `motor_vehicle`, and a `oneway` column comes by default. The SQL was also reworked for GDAL 3.10 compatibility — the recurring tax this package pays.

    View source ↗
  4. 2y ago

    51 new openstreetmap.fr regions and a GDAL 3.9 fix

    Provider coverage expands substantially — 51 new openstreetmap.fr areas across Asia, Europe, Turkey, Portugal and the Pacific, plus new BBBike and Geofabrik regions. Coverage is the raw material here, so widening the provider tables is real user-facing value even when the code barely changes.

    View source ↗
  5. 3y ago

    Non-Geofabrik downloads were saved under the wrong filename

    A data-integrity fix serious enough that the release notes tell users to delete their cached `.pbf` and `.gpkg` files: exact matches against non-default providers were being written with Geofabrik filenames. Two further fixes cover empty key values and colon-containing tags like `lanes:left`.

    View source ↗
  6. 3y ago

    Help files regenerated for valid HTML5

    CRAN documentation compliance and nothing else — `man/` regenerated so the help pages emit valid HTML5.

    View source ↗