Build an Overpass query
opq(bbox = NULL, timeout = 25, memsize)
| bbox | Either (i) four numeric values specifying the maximal and minimal
longitudes and latitudes, in the form |
|---|---|
| timeout | It may be necessary to increase this value for large queries, because the server may time out before all data are delivered. |
| memsize | The default memory size for the 'overpass' server in bytes; may need to be increased in order to handle large queries. |
An overpass_query object
See
https://wiki.openstreetmap.org/wiki/Overpass_API#Resource_management_options_.28osm-script.29
for explanation of timeout and memsize (or maxsize in overpass terms).
Note in particular the comment that queries with arbitrarily large memsize
are likely to be rejected.
if (FALSE) { q <- getbb ("portsmouth", display_name_contains = "USA") opq () add_osm_feature("amenity", "restaurant") add_osm_feature("amenity", "pub") osmdata_sf (q) # all objects that are restaurants AND pubs (there are none!) q1 <- getbb ("portsmouth", display_name_contains = "USA") opq () add_osm_feature("amenity", "restaurant") q2 <- getbb ("portsmouth", display_name_contains = "USA") opq () add_osm_feature("amenity", "pub") c (osmdata_sf (q1), osmdata_sf (q2)) # all restaurants OR pubs }