-
Notifications
You must be signed in to change notification settings - Fork 300
Description
Describe the bug
st_make_valid() throws the following error when the CRS for x is lat/lon and the user specifies a geos_method argument:
Error in st_make_valid.sfc(st_geometry(x), ...) :
missing(geos_method) is not TRUE
The issue happens with sf 1.0-15 and 1.0-16 but not 1.0-12. I'm wondering if it's related to e0dd1de
To Reproduce
library(sf)
# WGS84
test_wgs84 <- data.frame(x = 1, y = 1, z = "hi") |>
st_as_sf(coords = c("x", "y"), crs = "WGS84")
# Works
st_make_valid(test_wgs84)
# Doesn't work
st_make_valid(test_wgs84, geos_method = "valid_structure")
st_make_valid(test_wgs84, geos_method = "valid_linework")
# NAD83
test_nad83 <- data.frame(x = 1, y = 1, z = "hi") |>
st_as_sf(coords = c("x", "y"), crs = "EPSG:4269")
# Works
st_make_valid(test_nad83)
# Doesn't work
st_make_valid(test_nad83, geos_method = "valid_structure")
st_make_valid(test_nad83, geos_method = "valid_linework")
# Alaska Albers Equal Area
test_aea <- data.frame(x = 1, y = 1, z = "hi") |>
st_as_sf(coords = c("x", "y"), crs = "EPSG:3338")
# All work
st_make_valid(test_aea)
st_make_valid(test_aea, geos_method = "valid_structure")
st_make_valid(test_aea, geos_method = "valid_linework")
If reporting a change from previous versions
Additional context
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.utf8 LC_CTYPE=English_United States.utf8 LC_MONETARY=English_United States.utf8
[4] LC_NUMERIC=C LC_TIME=English_United States.utf8
time zone: America/Los_Angeles
tzcode source: internal
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] sf_1.0-16
loaded via a namespace (and not attached):
[1] s2_1.1.6 utf8_1.2.4 R6_2.5.1 tidyselect_1.2.0 e1071_1.7-14 magrittr_2.0.3
[7] glue_1.7.0 tibble_3.2.1 KernSmooth_2.23-22 pkgconfig_2.0.3 generics_0.1.3 dplyr_1.1.4
[13] wk_0.9.1 lifecycle_1.0.4 classInt_0.4-10 cli_3.6.2 fansi_1.0.6 grid_4.3.2
[19] vctrs_0.6.5 DBI_1.2.1 proxy_0.4-27 class_7.3-22 compiler_4.3.2 rstudioapi_0.15.0
[25] tools_4.3.2 pillar_1.9.0 Rcpp_1.0.12 rlang_1.1.3 units_0.8-5 `