osmdata imports OpenStreetMap (OSM) data into R as either Simple Features or R Spatial objects, respectively able to be processed with the R packages sf and sp. OSM data are extracted from the Overpass API and processed with very fast C++ routines for return to R. The package enables simple Overpass queries to be constructed without the user necessarily understanding the syntax of the Overpass query language, while retaining the ability to handle arbitrarily complex queries. Functions are also provided to enable recursive searching between different kinds of OSM data (for example, to find all lines which intersect a given point). The package is faster than current alternatives for importing OSM data into R and is the only one compatible with sf.


Eugster, Manuel J a, and Thomas Schlesinger. 2012. “Osmar: OpenStreetMap and R.” The R Journal 5 (1): 53–64.

Johnson, Peter A. 2017. “Models of Direct Editing of Government Spatial Data: Challenges and Constraints to the Acceptance of Contributed Data.” Cartography and Geographic Information Science 44 (2): 128–38. doi:10.1080/15230406.2016.1176536.

Lovelace, Robin. 2014. “Harnessing Open Street Map Data with R and QGIS.” EloGeo.

Mashhadi, Afra, Giovanni Quattrone, and Licia Capra. 2015. “The Impact of Society on Volunteered Geographic Information: The Case of Openstreetmap.” In OpenStreetMap in Giscience, 125–41. Springer.

Neis, Pascal, and Alexander Zipf. 2012. “Analyzing the Contributor Activity of a Volunteered Geographic Information Project—the Case of Openstreetmap.” ISPRS International Journal of Geo-Information 1 (2). Molecular Diversity Preservation International: 146–65.

Olbricht, Roland M. 2015. “Data Retrieval for Small Spatial Regions in Openstreetmap.” In OpenStreetMap in Giscience, 101–22. Springer.

OpenStreetMap contributors. 2017. “Planet dump retrieved from http://planet.osm.org.” http://www.openstreetmap.org.

Padgham, Mark. 2016. Osmplotr: Customisable Images of Openstreetmap Data. https://cran.r-project.org/package=osmplotr.