read_osm: Read an XML OSM Overpass response from path

Description Usage Arguments Value Note Examples

View source: R/read_osm.R

Description

Read an (XML format) OSM Overpass response from a string, a connection, or a raw vector.

Usage

1
read_osm(osm_response, encoding = "")

Arguments

osm_response

file containing an OSM Overpass (XML) response. Can be A string, a connection, or a raw vector.
A string can be either a path, a url or literal xml. Urls will be converted into connections either using base::url or, if installed, curl::curl. Local paths ending in .gz, .bz2, .xz, .zip will be automatically uncompressed.

encoding

Specify a default encoding for the document. Unless otherwise specified XML documents are assumed to be in UTF-8 or UTF-16. If the document is not UTF-8/16, and lacks an explicit encoding directive, this allows you to supply a default.

Value

If the query result only has OSM nodes then the function will return a SpatialPointsDataFrame with the nodes.

If the query result has OSM ways then the function will return a SpatialLinesDataFrame with the ways

relationss are not handled yet.

Note

You can disable progress bars by calling pbapply::pboptions(type="none") in your code. See pboptions for all the various progress bar settings.

Examples

1
mammoth <- read_osm(system.file("osm/mammoth.osm", package="overpass"))

hrbrmstr/overpass documentation built on May 17, 2019, 5:11 p.m.