Get the bbox of a result, as an SF polygon.

osm.osmdata_result_2_bbox_pol(osmdata_result)

Arguments

osmdata_result

An osmdata result.

Value

An SF polygon which is the bbox of the osmdata result.

Author

Dimitris Kavroudakis dimitris123@gmail.com

Examples

library(devtools)
#install_github("dimitrisk/goal")
library(goal)
library(sf)
library(stringr)
am = goal::osm.getPOI_usingbb( c(26.547303,39.101658,26.564641,39.113247), inkey ="amenity" )
#> Issuing query to Overpass API ...
#> Announced endpoint: gall.openstreetmap.de/
#> Query complete!
#> converting OSM data to sf format
amenities = goal::osm.combineAmenities(am)
#> Warning: st_centroid assumes attributes are constant over geometries
#> Warning: GDAL Error 1: PROJ: proj_as_wkt: DatumEnsemble can only be exported to WKT2:2019
#> Warning: GDAL Error 1: PROJ: proj_as_wkt: DatumEnsemble can only be exported to WKT2:2019
#> Warning: st_centroid assumes attributes are constant over geometries
#> Warning: GDAL Error 1: PROJ: proj_as_wkt: DatumEnsemble can only be exported to WKT2:2019
thepol = goal::osm.osmdata_result_2_bbox_pol(am)
#> Warning: GDAL Error 1: PROJ: proj_as_wkt: DatumEnsemble can only be exported to WKT2:2019