Issue OSM Overpass Query

overpass_query(query, quiet = FALSE, wait = TRUE)

Arguments

query
OSM Overpass query. Please note that the function is in ALPHA dev stage and needs YOU to specify that the output type is XML. However, you can use Overpass XML or Overpass QL formats.
quiet
suppress status messages. OSM Overpass queries may not return quickly. The package will display status messages by default showing when the query started/completed. You can disable these messages by setting this value to TRUE.
wait
if TRUE and if there is a queue at the Overpass API server, should this function wait and try again at the next available slot time or should it throw a an exception?

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. If you asked for a CSV, you will receive the text response back, suitable for processing by read.table(text=..., sep=..., header=TRUE, check.names=FALSE, stringsAsFactors=FALSE).

Note

wrap function with httr::with_verbose if you want to see the httr query (useful for debugging connection issues).

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

Examples

## Not run: ------------------------------------ # only_nodes <- '[out:xml]; # node # ["highway"="bus_stop"] # ["shelter"] # ["shelter"!~"no"] # (50.7,7.1,50.8,7.25); # out body;' # # pts <- overpass_query(only_nodes) ## ---------------------------------------------