Skip to contents

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

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

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

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

## With vignettes (also accessible at https://jmaspons.github.io/osmapiR/ > Articles)
# install.packages("rmarkdown") # Needed to build vignettes.
remotes::install_github("jmaspons/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").

  • 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 can be 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 the OSM map data for purposes other than editing or exploring the history of the objects, perhaps is better to use the other packages that implements the Overpass API (osmdata) or that works with .pbf files (osmextract).

Code of Conduct

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