Skip to content

Commit

Permalink
Merge pull request #385 from StoXProject/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
arnejohannesholmin authored Jan 10, 2025
2 parents 1887c98 + b89beed commit b1cc201
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: RstoxBase
Version: 2.1.1
Date: 2024-12-19
Version: 2.1.2-9001
Date: 2025-01-09
Title: Base StoX Functions
Authors@R: c(
person(given = "Arne Johannes",
Expand Down
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# RstoxBase v2.1.2-9001 (2025-01-10)
* Changed the behavior of DefinitionMethod = "Manual" from deleting all strata, to passing the StratumPolygon as output unchanged. In addition, a new option is added, "DeleteAllStrata", which replaces the old behavior of DefinitionMethod = "Manual".

# RstoxBase v2.1.1 (2024-12-19)
* Final release for StoX 4.1.1.
* Updated documentation of the AcousticPSU process data.
Expand Down
13 changes: 11 additions & 2 deletions R/Spatial.R
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ readStoxMultipolygonWKTFromFile <- function(FilePath) {
#'
DefineStratumPolygon <- function(
processData, UseProcessData = FALSE,
DefinitionMethod = c("Manual", "ResourceFile"),
DefinitionMethod = c("Manual", "DeleteAllStrata", "ResourceFile"),
FileName = character(),
StratumNameLabel = character(),
SimplifyStratumPolygon = FALSE,
Expand All @@ -137,9 +137,18 @@ DefineStratumPolygon <- function(
if(grepl("ResourceFile", DefinitionMethod, ignore.case = TRUE)) {
StratumPolygon <- readStratumPolygonFromFile(FileName, StratumNameLabel = StratumNameLabel)
}
else if(grepl("Manual", DefinitionMethod, ignore.case = TRUE)) {
else if(grepl("DeleteAllStrata", DefinitionMethod, ignore.case = TRUE)) {
StratumPolygon <- getRstoxBaseDefinitions("emptyStratumPolygon")
}
# Manual implies to use the existing process data, or create an empty set if not present:
else if(grepl("Manual", DefinitionMethod, ignore.case = TRUE)) {
if(length(processData)) {
StratumPolygon <- processData
}
else {
StratumPolygon <- getRstoxBaseDefinitions("emptyStratumPolygon")
}
}
else {
stop("Inavlid DefinitionMethod")
}
Expand Down
2 changes: 1 addition & 1 deletion man/DefineStratumPolygon.Rd

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

0 comments on commit b1cc201

Please sign in to comment.