osmdata (version 0.0.5)

opq: Build an Overpass query

Description

Build an Overpass query

Usage

opq(bbox = NULL)

Arguments

bbox

Either (i) four numeric values specifying the maximal and minimal longitudes and latitudes; (ii) a character string passed to getbb to be converted to a numerical bounding box; or (iii) a matrix representing a bounding polygon as returned from getbb(..., format_out = "polygon").

Value

An overpass_query object

Examples

Run this code
# NOT RUN {
q <- getbb ("portsmouth", display_name_contains = "United States") %>%
            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 = "United States") %>%
                opq () %>% 
                add_osm_feature("amenity", "restaurant") 
q2 <- getbb ("portsmouth", display_name_contains = "United States") %>%
                opq () %>% 
                add_osm_feature("amenity", "pub") 
c (osmdata_sf (q1), osmdata_sf (q2)) # all objects that are restaurants OR pubs
# }

Run the code above in your browser using DataLab