Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

osmdata_xml

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


Description

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

Usage

osmdata_xml(q, filename, quiet = TRUE, encoding)

Arguments

q

An object of class overpass_query constructed with opq and add_osm_feature.

filename

If given, OSM data are saved to the named file

quiet

suppress status messages.

encoding

Unless otherwise specified XML documents are assumed to be encoded as 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

An object of class XML::xml_document containing the result of the overpass API query.

Note

Objects of class xml_document can be saved as .xml or .osm files with xml2::write_xml.

See Also

Other extract: osmdata_sc(), osmdata_sf(), osmdata_sp()

Examples

## Not run: 
q <- opq ("hampi india")
q <- add_osm_feature (q, key = "historic", value = "ruins")
osmdata_xml (q, filename = "hampi.osm")

## End(Not run)

osmdata

Import 'OpenStreetMap' Data as Simple Features or Spatial Objects

v0.1.10
GPL-3
Authors
Mark Padgham [aut, cre], Bob Rudis [aut], Robin Lovelace [aut], Maëlle Salmon [aut], Andrew Smith [ctb], James Smith [ctb], Andrea Gilardi [ctb], Enrico Spinielli [ctb], Anthony North [ctb], Martin Machyna [ctb], Marcin Kalicinski [ctb, cph] (Author of included RapidXML code)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.