osmdata (version 0.0.5)

osmdata_sf: Return an OSM Overpass query as an osmdata object in sf format.

Description

Return an OSM Overpass query as an osmdata object in sf format.

Usage

osmdata_sf(q, doc, quiet = TRUE, encoding)

Arguments

q

An object of class `overpass_query` constructed with opq and add_osm_feature. May be be omitted, in which case the osmdata object will not include the query.

doc

If missing, doc is obtained by issuing the overpass query, q, otherwise either the name of a file from which to read data, or an object of class XML returned from osmdata_xml.

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 `osmdata` with the OSM components (points, lines, and polygons) represented in sf format.

Examples

Run this code
# NOT RUN {
hampi_sf <- opq ("hampi india") %>%
            add_osm_feature (key="historic", value="ruins") %>%
            osmdata_sf ()
# }

Run the code above in your browser using DataLab