Skip to contents

This function retrieves the city boundary from OpenStreetMap based on a bounding box with the OSM tags "place:city" and "boundary:administrative". The result is filtered by the city name.

Usage

get_osm_city_boundary(bb, city_name, crs = NULL, multiple = FALSE)

Arguments

bb

Bounding box of class bbox

city_name

A character string with the name of the city

crs

Coordinate reference system as EPSG code

multiple

A logical indicating if multiple city boundaries should be returned. By default, only the first one is returned.

Value

An sf object with the city boundary

Examples

bb <- get_osm_bb("Bucharest")
crs <- get_utm_zone(bb)
get_osm_city_boundary(bb, "Bucharest", crs)
#> Geometry set for 1 feature 
#> Geometry type: MULTIPOLYGON
#> Dimension:     XY
#> Bounding box:  xmin: 417769.7 ymin: 4909348 xmax: 438364 ymax: 4932424
#> Projected CRS: WGS 84 / UTM zone 35N
#> MULTIPOLYGON (((427347.8 4913289, 427386.6 4913...