library(tmap)
dresden <-
osmdata::getbb("Dresden") %>%
osmdata::opq(timeout = 25*100) %>%
osmdata::add_osm_feature(
key = "building",
value = c("house", "residential")
) %>%
osmdata::osmdata_sf() %>%
.$osm_polygons %>%
tibble::as_tibble() %>%
sf::st_as_sf()
dresden
## Simple feature collection with 13927 features and 114 fields
## geometry type: POLYGON
## dimension: XY
## bbox: xmin: 13.57913 ymin: 50.97482 xmax: 13.96545 ymax: 51.17778
## geographic CRS: WGS 84
## # A tibble: 13,927 x 115
## osm_id name X3dr.type abandoned access addr.city addr.country addr.housename
## <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
## 1 22986~ <NA> <NA> <NA> <NA> Dresden <NA> <NA>
## 2 22986~ <NA> <NA> <NA> <NA> Dresden DE <NA>
## 3 22986~ <NA> <NA> <NA> <NA> Dresden DE <NA>
## 4 22986~ <NA> <NA> <NA> <NA> Dresden DE <NA>
## 5 22986~ <NA> <NA> <NA> <NA> Dresden DE <NA>
## 6 22986~ <NA> <NA> <NA> <NA> Dresden DE <NA>
## 7 22986~ <NA> <NA> <NA> <NA> Dresden DE <NA>
## 8 22986~ <NA> <NA> <NA> <NA> Dresden DE <NA>
## 9 22986~ <NA> <NA> <NA> <NA> Dresden DE <NA>
## 10 22986~ <NA> <NA> <NA> <NA> Dresden <NA> <NA>
## # ... with 13,917 more rows, and 107 more variables: addr.housenumber <chr>,
## # addr.postcode <chr>, addr.street <chr>, addr.suburb <chr>,
## # addr.suburb.en <chr>, alt_name <chr>, amenity <chr>, animal <chr>,
## # attraction <chr>, building <chr>, building.architecture <chr>,
## # building.colour <chr>, building.levelPlan <chr>, building.levels <chr>,
## # building.levels.underground <chr>, building.material <chr>,
## # building.part <chr>, building.roof <chr>, building.roof.colour <chr>,
## # building.roof.shape <chr>, building.use <chr>, castle_type <chr>,
## # cn_tud.token <chr>, colour <chr>, comment <chr>, construction <chr>,
## # construction.building <chr>, contact.email <chr>, contact.fax <chr>,
## # contact.mobile <chr>, contact.phone <chr>, contact.website <chr>,
## # created_by <chr>, description <chr>, description.de <chr>, disused <chr>,
## # dormitory <chr>, ele <chr>, email <chr>, emergency <chr>,
## # emergency_service <chr>, entrance <chr>, fax <chr>, fixme <chr>,
## # healthcare <chr>, height <chr>, heritage <chr>, heritage.operator <chr>,
## # historic <chr>, image <chr>, internet_access <chr>, last_check <chr>,
## # layer <chr>, loc_name <chr>, loc_ref <chr>, location <chr>, man_made <chr>,
## # microbrewery <chr>, min_height <chr>, name.en <chr>, noaddress <chr>,
## # nohousenumber <chr>, note <chr>, number_of_apartments <chr>, office <chr>,
## # old_name <chr>, opening_hours <chr>, operator <chr>, outdoor_area <chr>,
## # phone <chr>, photo <chr>, railway <chr>, railway.ref <chr>,
## # railway.signal_box <chr>, roof.angle <chr>, roof.colour <chr>,
## # roof.height <chr>, roof.levels <chr>, roof.material <chr>,
## # roof.orientation <chr>, roof.ridge <chr>, roof.shape <chr>,
## # school_type <chr>, seamark.landmark.category <chr>,
## # seamark.landmark.conspicuity <chr>, seamark.type <chr>, shop <chr>,
## # smoking <chr>, social_facility <chr>, social_facility.for <chr>,
## # source <chr>, source.addr.housenumber <chr>, source.building <chr>,
## # source.geometry <chr>, sport <chr>, stars <chr>, start_date <chr>,
## # survey.date <chr>, tourism <chr>, url <chr>, ...
tm_shape(dresden) +
tm_polygons()
## Linking to GEOS 3.8.0, GDAL 3.0.4, PROJ 6.3.1