Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ Imports:
units,
filelock,
geosphere,
geos
geos,
iterators,
mmap
LazyData: true
Description: Support for morphometric calculations of building footprints implemented in R. It provides flexible tools for processing 2D vector polygon representations of structures. The functionality includes basic geometry and morphology measures, distance and clustering metrics. These calculations are supported with helper functions for spatial intersections to define zonal indices and tiled reading/writing of data files.
Encoding: UTF-8
Expand Down
7 changes: 7 additions & 0 deletions R/calculate_pixel_footstats.R
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ calc_fs_px_internal <- function(X, what, how,
tiles <- gridTiles(template, px=tileSize)

if(verbose){
cat("Number of tiles created:", nrow(tiles), "\n")
file.create(tile_log <- file.path(outputPath, "tile.log"))
}

Expand Down Expand Up @@ -530,6 +531,12 @@ process_tile <- function(mgTile, mgBuffTile,
suppressWarnings(Xsub <- sf::st_cast(Xsub, "POLYGON"))
}

#make valid
if(any(sf::st_is_valid(Xsub) == F)){
if(verbose){cat('Invalid geometries found in polygons and corrected')}
suppressWarnings(Xsub <- sf::st_make_valid(Xsub))
}
Comment on lines +534 to +538

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea here. However, I think it might be better for this to be moved near R/calculate_footstats.R in . calculate_bigfoot calls calculate_footstats so by adding the fix there, anyone using calculate_footstats directly (for polygon area summaries) would also benefit.


# processing
if(nrow(Xsub) > 0){
# read proxy to grid and convert to polygon object
Expand Down