Learn R Programming

osmapiR

An R interface to the OpenStreetMap API v0.6 for fetching and saving raw geodata from/to the OpenStreetMap database. This package allows access to OSM maps data as well as map notes, GPS traces, changelogs, and users data. osmapiR enables editing or exploring the history of OSM objects, and is not intended to access OSM map data for other purposes. See Related packages for other packages to access OSM map data.

[!IMPORTANT]
You are responsible for following the API Usage Policy. You can modify the user agent of the requests by setting the option osmapir.user_agent:

options(osmapir.user_agent = "my new user agent")

Respect and follow the standards and conventions of the OpenStreetMap community. If you plan to do automated edits, check the Automated Edits code of conduct.

Installation

To install latest CRAN version:

install.packages("osmapiR")

You can install the development version of osmapiR from GitHub with:

# install.packages("remotes")
remotes::install_github("ropensci/osmapiR") # Without vignettes

## With vignettes (also accessible at https://docs.ropensci.org/osmapiR/ > Articles)
# install.packages("rmarkdown") # Needed to build vignettes.
remotes::install_github("ropensci/osmapiR", build_vignettes = TRUE)

Get started

For an overview of the functions, check ?osmapiR-package or the web.

For basic examples, check vignette("osmapiR", package="osmapiR").

Related packages

  • osmdata implements the Overpass API to query data from OSM.
  • osmextract matches, downloads, converts, and imports bulk OSM data (.pbf files).
  • OpenStreetMap accesses high resolution raster maps using the OpenStreetMap protocol.

osmapiR is the only package to access other OSM data than the maps data (map notes, GPS traces, changelogs and users). It is also useful to get the history of the OSM objects and is the only package that allows editing and upload any kind of data.

To access OSM map data for purposes other than editing or exploring the history of objects, it may be better to use other packages that implement the Overpass API (osmdata) or that works with .pbf files (osmextract).

Code of Conduct

Please note that this package is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

Copy Link

Version

Install

install.packages('osmapiR')

Monthly Downloads

610

Version

0.2.3

License

GPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

Joan Maspons

Last Published

April 15th, 2025

Functions in osmapiR (0.2.3)

osm_feed_notes

RSS Feed of notes in a bbox
osm_download_changeset

Download a changeset in OsmChange format
osm_delete_gpx

Delete GPS traces
osm_create_user_block

Create a user block
osm_details_logged_user

Details of the logged-in user
osm_diff_upload_changeset

Diff (OsmChange format) upload to a changeset
osm_hide_comment_changeset_discussion

Hide or unhide a changeset comment
osm_get_user_blocks

Read user block
osm_delete_note

Delete notes
osm_delete_object

Delete an OSM object
osm_history_object

Get the history of an object
osm_create_note

Create a new note
osm_get_points_gps

Get GPS Points
osm_list_active_user_blocks

List active blocks
osm_get_gpx_metadata

Download GPS Track Metadata
osm_get_notes

Get notes
osm_get_user_details

Details of users
osm_permissions

Retrieving permissions
osm_create_object

Create an OSM object
osm_get_objects

Get OSM objects
osm_list_gpxs

List user's GPX traces
osm_read_bbox_notes

Retrieve notes by bounding box
osm_query_changesets

Query changesets
osm_redaction_object

Redact an object version
osmchange_modify

osmchange to modify existing OSM objects
osm_get_changesets

Get changesets
osm_relations_object

Relations of an object
osmchange_create

osmchange to create OSM objects
osmchange_delete

osmchange to delete existing OSM objects
osm_update_object

Update an OSM object
osm_ways_node

Ways of a node
osm_get_preferences_user

Get or set preferences for the logged-in user
st_as_sf

Convert osmapiR objects to sf objects
osmapiR-package

osmapiR: 'OpenStreetMap' API
tags_list2wide

Change tags from a list column <-> columns for each key in wide format
osmapi_objects

osmapi_objects constructor
osm_search_notes

Search for notes
osm_subscribe_changeset_discussion

Subscribe or unsubscribe to a changeset discussion
osm_get_data_gpx

Download GPS Track Data
osm_subscribe_note

Subscribe or unsubscribe to a note
osm_update_gpx

Update GPS trace
authenticate_osmapi

Authenticate or logout osmapiR
osm_create_changeset

Create, update, or close a changeset
osm_api_versions

Available API versions
osm_comment_changeset_discussion

Comment a changeset
set_osmapi_connection

Configure connections from osmapiR
osm_close_note

Close or reopen notes
osm_create_gpx

Create GPS trace
osm_bbox_objects

Retrieve map data by bounding box
osm_create_comment_note

Create a new comment in a note
osm_capabilities

Capabilities of the API