Skip to content

Commit

Permalink
added st_make_valid() to QMA and stat area funcs
Browse files Browse the repository at this point in the history
  • Loading branch information
quantifish committed Sep 29, 2024
1 parent c7d52dd commit 7507373
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion R/plot-qma.R
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ get_qma <- function(qma = "CRA", proj = proj_nzsf()) {
x <- x %>%
st_transform(crs = proj, check = TRUE) %>%
st_union(by_feature = TRUE) %>%
st_cast("MULTIPOLYGON")
st_cast("MULTIPOLYGON") %>%
st_make_valid()
}
return(x)
}
Expand Down
3 changes: 2 additions & 1 deletion R/plot-statistical-areas.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ get_statistical_areas <- function(area = "CRA", proj = proj_nzsf()) {
x <- x %>%
# st_transform(crs = proj, check = TRUE) %>%
st_transform(crs = proj) %>%
st_union(by_feature = TRUE)
st_union(by_feature = TRUE) %>%
st_make_valid()
# if (!area %in% "EEZ") {
# x <- x %>% st_cast("MULTIPOLYGON")
# }
Expand Down

0 comments on commit 7507373

Please sign in to comment.