overpass_query: Issue OSM Overpass Query

Description Usage Arguments Value Note Examples

View source: R/overpass_query.r

Description

Issue OSM Overpass Query

Usage

1
overpass_query(query, quiet = FALSE, wait = TRUE, pad_wait = 5)

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?

pad_wait

if there is a queue and wait is TRUE, pad the next query start time by pad_wait seconds (default = 5 seconds).

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## 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)

## End(Not run)

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