ohsome_extract_elements {ohsome} | R Documentation |
Extract OSM elements
Description
Create an ohsome_query
object for OSM element extraction
Usage
ohsome_extract_elements(
boundary = NULL,
geometryType = c("centroid", "bbox", "geometry"),
time = NULL,
properties = NULL,
clipGeometry = TRUE,
...
)
ohsome_elements_bbox(boundary = NULL, ...)
ohsome_elements_centroid(boundary = NULL, ...)
ohsome_elements_geometry(boundary = NULL, ...)
Arguments
boundary |
Bounding geometries specified by WGS84 coordinates in the
order
|
geometryType |
character; type of geometry to be extracted:
Caveat: Node elements are omitted from results in queries for bounding boxes. |
time |
character; |
properties |
character; properties to be extracted with the features:
Multiple values can be provided as comma-separated character or as
character vector. This defaults to |
clipGeometry |
logical; specifies whether the returned geometries should be clipped to the query’s spatial boundary |
... |
Parameters of the request to the ohsome API endpoint. |
Details
ohsome_extract_elements()
creates an ohsome_query
object for OSM element
extraction. ohsome_elements_bbox()
, ohsome_elements_centroid()
and
ohsome_elements_geometry()
are wrapper functions for specific elements
extraction endpoints. Boundary objects are passed via set_boundary()
into
ohsome_boundary()
.
Value
An ohsome_query
object. The object can be sent to the ohsome API
with ohsome_post()
. It consists of the following elements:
-
url
: The URL of the endpoint. -
encode
: The way the information is encoded and then posted to the ohsome API. Set as"form"
. -
body
: The parameters of the query such asformat
,filter
orbpolys
.
See Also
ohsome API Endpoints – Elements Extraction
Examples
# Extract geometries, metadata and tags of man-made objects around "Null Island":
ohsome_elements_geometry(
"0,0,10",
filter = "man_made=*",
time = "2022-01-01",
properties = c("metadata", "tags")
)