Skip to content

Commit

Permalink
changed size check to a warning, but only for lakes smaller than a 3x…
Browse files Browse the repository at this point in the history
…3 window of the set resolution.
  • Loading branch information
jhollist committed Sep 25, 2024
1 parent 8873c45 commit 541e278
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ inst/doc
inst/extdata
R/gam_depth.R
bugs
raster_maxlength
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ lakemorpho 1.3.3 (2024-XX-xx)

## Updates
- Added fasterize for rasterizing lakes
- lakeSurroundTopo: size check for small lakes assumed 30 meter pixels and returned NULL. Changed this to use reso to determine size check, still creates lake morpho object but with a warning.

lakemorpho 1.3.2 (2023-09-15)
==========================
Expand Down
4 changes: 2 additions & 2 deletions R/lakeSurroundTopo.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ lakeSurroundTopo <- function(inLake, inElev = NULL, inCatch = NULL,
#slot(inLake, "polygons") <- lapply(slot(inLake, "polygons"), checkPolygonsHoles)
# Ignores lakes smaller that 3X3 30 m pixels

if (as.numeric(sf::st_area(inLake)) <= 8100) {
return(NULL)
if (as.numeric(sf::st_area(inLake)) <= (reso*3)^2) {
warning("The input lake polygon is very small and resulting metrics may not make sense.")
}
tmpBuff <- sf::st_buffer(inLake, dist = 180)
nc <- round((extent(tmpBuff)@xmax - extent(tmpBuff)@xmin)/reso)
Expand Down

0 comments on commit 541e278

Please sign in to comment.