opq_around: opq_around

opq_aroundR Documentation

opq_around

Description

Find all features around a given point, and optionally match specific 'key'-'value' pairs. This function is not intended to be combined with add_osm_feature, rather is only to be used in the sequence opq_around -> osmdata_xml (or other extraction function). See examples for how to use.

Usage

opq_around(lon, lat, radius = 15, key = NULL, value = NULL, timeout = 25)

Arguments

lon

Longitude of desired point

lat

Latitude of desired point

radius

Radius in metres around the point for which data should be extracted. Queries with large values for this parameter may fail.

key

(Optional) OSM key of enclosing data

value

(Optional) OSM value matching 'key' of enclosing data

timeout

It may be necessary to increase this value for large queries, because the server may time out before all data are delivered.

See Also

Other queries: add_osm_features(), add_osm_feature(), bbox_to_string(), getbb(), opq_csv(), opq_enclosing(), opq_osm_id(), opq_string(), opq(), overpass_status()

Examples

## Not run: 
# Get all benches ("amenity=bench") within 100m of a particular point
lat <- 53.94542
lon <- -2.52017
key <- "amenity"
value <- "bench"
radius <- 100
x <- opq_around (lon, lat, radius, key, value) %>%
    osmdata_sf ()

## End(Not run)

osmdata documentation built on Aug. 14, 2023, 5:08 p.m.