osmdata (version 0.2.5)

bbox_to_string: Convert a named matrix or a named or unnamed vector or data.frame to a string

Description

This function converts a bounding box into a string for use in web apis

Usage

bbox_to_string(bbox)

Value

A character string representing min x, min y, max x, and max y bounds. For example: "15.3152361,76.4406446,15.3552361,76.4806446" is the bounding box for Hampi, India. For data.frames with OSM objects, a character string representing a set of OSM objects in overpass query language. For example: "relation(id:11747082)" represents the area of the Catalan Countries. A set of objects can also be represented for multirow data.frames (e.g. "relation(id:11747082,307833); way(id:22422490)").

Arguments

bbox

bounding box as character, matrix, vector or a data.frame with osm_type and osm_id columns. If character, the bbox will be found (geocoded) and extracted with getbb. Unnamed vectors will be sorted appropriately and must merely be in the order (x, y, x, y).

See Also

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

Examples

Run this code
if (FALSE) {
bbox_to_string (getbb ("València"))
bbox_to_string (getbb ("València", format_out = "data.frame"))
}

Run the code above in your browser using DataLab