Skip to content

Commit

Permalink
Add removal of invalid building polygons in get_buildings_osm(), whic…
Browse files Browse the repository at this point in the history
…h remained in spite of st_make_valid(). Related to r-spatial/sf#1649
  • Loading branch information
xp-song committed Aug 4, 2021
1 parent d964c8d commit 43312e7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

* Fix error in `rasterise_buildings()`. Getting the files for land use rasters resulted in an error (e.g. multiple files). Syntax for re-naming for the output using the `glue::glue()` function also did not work within package environment.

* Add removal of invalid building polygons in `get_buildings_osm()`, which remained in spite of `st_make_valid()`. Related to https://github.com/r-spatial/sf/issues/1649

<br>

# home2park 0.1.0
Expand Down
3 changes: 3 additions & 0 deletions R/get_buildings_osm.R
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ get_buildings_osm <- function(place, date = NULL, dir_raw = osmextract::oe_downl
sf::st_cast("MULTIPOLYGON", warn = FALSE) %>%
sf::st_cast("POLYGON", warn = FALSE))

# rm invalid building polygons
results <- results[sf::st_is_valid(results),]

# convert building_levels ---- if no info, set as 1; if underground, NA; convert to
# numeric, round up
suppressWarnings(results <- results %>%
Expand Down
1 change: 1 addition & 0 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ visitors'
'
doi
figshare
zenodo

0 comments on commit 43312e7

Please sign in to comment.