Skip to content

Commit

Permalink
check added for very skinny polys on lakemajor- and lakeminor- axis.
Browse files Browse the repository at this point in the history
  • Loading branch information
jhollist committed Jan 10, 2024
1 parent 807201a commit 805f9f6
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: lakemorpho
Type: Package
Title: Lake Morphometry Metrics
Version: 1.3.2
Version: 1.3.3.9999
Authors@R: c(
person(given = "Jeffrey W.", family = "Hollister",
role = c("aut","cre"),
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
lakemorpho 1.3.3 (2024-XX-xx)
=============================
## Bug Fixes
- Bug on very skinny polys for lakeMajorAxis and lakeMinorAxis. Checks for matrix and returns NA if not.

lakemorpho 1.3.2 (2023-09-15)
==========================

Expand Down
4 changes: 2 additions & 2 deletions R/lakeMajorAxisLength.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@


lakeMajorAxisLength <- function(inLakeMorpho, addLine = TRUE) {

if (!inherits(inLakeMorpho, "lakeMorpho")) {
stop("Input data is not of class 'lakeMorpho'. Run lakeSurround Topo or lakeMorphoClass first.")
}
Expand All @@ -46,7 +46,7 @@ lakeMajorAxisLength <- function(inLakeMorpho, addLine = TRUE) {
} else {
myLine.max <- elpshull[round(dist2center,8) == round(max(dist2center),8),]
}

if(!is.matrix(myLine.max)){return(NA)}
myLine <- st_sfc(sf::st_linestring(myLine.max), crs = sf::st_crs(inLakeMorpho$lake))


Expand Down
1 change: 1 addition & 0 deletions R/lakeMeanWidth.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#'
#' @examples
#' data(lakes)
#' lakeMaxLength(inputLM, 25)
#' lakeMeanWidth(inputLM)
#'

Expand Down
2 changes: 1 addition & 1 deletion R/lakeMinorAxisLength.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ lakeMinorAxisLength <- function(inLakeMorpho, addLine = TRUE) {
} else {
myLine.min <- rbind(elpshull.center, elpshull[round(dist2center,8) == round(min(dist2center),8),])
}

if(!is.matrix(myLine.min)){return(NA)}
myLine <- st_sfc(sf::st_linestring(myLine.min), crs = sf::st_crs(inLakeMorpho$lake))

result <- as.numeric(sf::st_length(myLine))
Expand Down
2 changes: 1 addition & 1 deletion R/zzz.r
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ op <- options()

.onAttach <- function(libname, pkgname) {
packageStartupMessage(
"lakemorpho v01.3.0 NOTE: Version 1.3.0 of 'lakemorpho' uses 'sf' for all vector
"lakemorpho v01.3.2 NOTE: Version 1.3.2 of 'lakemorpho' uses 'sf' for all vector
processing. The 'rgdal' and 'rgeos' pacakges have been removed. 'raster' is
still used for raster data handling. The output lakeMorpho class no longer
contains `sp` objects. In subsequent releases, 'lakemorpho' will use only 'sf'
Expand Down
1 change: 1 addition & 0 deletions cran_comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Release 1.3.2 fixes slow running examples
- Github Actions, Microsoft Windows Server 2022, R Version 4.2.3
- Github Actions, Mac OS 12.6.8, R Version 4.3.1
- R Project, macOS builder
- rhub::check_on_debian(), no example runtime notes
- Local, Windows 10 x64 (build 22000), R version 4.2.2 (2022-10-31 ucrt)

## R CMD check results
Expand Down
1 change: 0 additions & 1 deletion man/lakeFetch.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion man/lakeMajorAxisLength.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion man/lakeMaxLength.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion man/lakeMaxWidth.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 805f9f6

Please sign in to comment.