← Back to all sparks
O

osmapiR

ANALYTICS
Velocity0.0

An R interface to OpenStreetMap API for fetching and saving data from/to the OpenStreetMap database

osmapiR is the rare API client that tracks its server's wiki revision numbers in the changelog.

openstreetmapapi-clientr-languagegeospatialoauth2
Current state
osmapiR wraps the full OpenStreetMap API from R — reading and writing map data, changesets, notes, GPX traces and user records — with OAuth2 where the endpoint requires it, pagination handled internally, and atomic calls vectorised. Recent releases have filled in the moderation and social surface: note subscription, user blocks, changeset discussion search. The newest release lets `bbox` arguments arrive as a character string, matrix, vector, an sf `bbox`, or a terra `SpatExtent`.
Where it's heading
Four consecutive releases open with the same line — documentation and code updated for server-side changes, cited by OSM wiki revision range. That is a maintainer treating an evolving remote API as a versioned contract and auditing against it each cycle, which is unusual discipline and the main reason to trust this client over a hand-rolled wrapper. The second thread is fitting into R's spatial conventions rather than exposing OSM's, visible in the bbox coercion work and the httr2 upgrades landing with upstream help.
Prediction
The pattern is stable enough to call: another release synchronised to the next OSM wiki revision range, adding whatever endpoints appeared and adjusting whatever changed shape.

Recent moves

  1. 5mo ago

    bbox arguments accept sf and terra objects

    Bounding boxes can now be passed as character, matrix, vector, an sf `bbox`, or a terra `SpatExtent`, removing the conversion step between the two dominant R spatial stacks and this client. Also adds changeset discussion comment search and the release's customary sync against the OSM wiki revision range.

    View source ↗
  2. 0y ago

    Note search defaults to creation order; JSON for GPX metadata

    A default worth changing — `osm_search_notes()` sorts by `created_at` rather than `updated_at`, which is what someone looking for new notes actually wants. JSON output arrives for `osm_get_gpx_metadata()`, internal endpoint functions are renamed with a dot prefix, and an httr2 1.2.0 compatibility fix lands ahead of that release.

    View source ↗
  3. 1y ago

    Note subscriptions and user block endpoints added

    Extends coverage into moderation and participation: subscribe and unsubscribe from notes, create and read user blocks, list active ones, with a vectorised `osm_get_user_blocks()` alongside the single-record reader. Deprecated endpoints are retired in the same pass.

    View source ↗
  4. 1y ago

    Changeset queries gain from and to parameters

    Adds `from` and `to` to `osm_query_changesets()` and fixes the older `time`/`time_2` pair, which had not been working as documented. Also picks up `httr2::oauth_cache_clear()` for token cache management.

    View source ↗
  5. 1y ago

    JOSS citation added; single-tag conversion fixed

    Records the JOSS article in CITATION and fixes `tags_list2wide()` for objects carrying exactly one tag. Small, though the single-tag case is the sort of edge condition that silently produces the wrong shape.

    View source ↗
  6. 2y ago

    Complete OSM API coverage arrives in one release

    ⚡ SPARK

    The initial release is unusually complete: every API endpoint, OAuth2 where required, pagination handled internally, and vectorised atomic calls. Starting from full coverage is why subsequent releases have been able to track the server's changes rather than chase missing features.

    View source ↗