HOPE-UIB-BIO / FOSSILPOL-issues

Repository created to manage Issues for FOSSILPOL and R-Fossilpol-package
https://hope-uib-bio.github.io/FOSSILPOL-website/
0 stars 0 forks source link

Issue with assign information based on geographical position #23

Open xbenitogranell opened 11 months ago

xbenitogranell commented 11 months ago

Run script '01_Merge_datasets.R' step#7 Assign information based on geographical position and got the following error:

Error in wk_handle.wk_wkb(wkb, s2_geography_writer(oriented = oriented, : Loop 0 is not valid: Edge 24464 crosses edge 24466 In addition: Warning message: In st_is_longlat(x) : bounding box has potentially an invalid value range for longlat data

I don't think the issue is coming from my Config_filebecause previous scripts within Neotoma_source run just fine. Below is the geographical boundaries I used:

long_min <- -5 # [USER] long_max <- 2 # [USER] lat_min <- 39 # [USER] lat_max <- 43 # [USER] alt_min <- NA # [USER] alt_max <- NA # [USER]

Any tip would be greatly appreciated! Thanks so much for creating this amazing, game-changer workflow for macroecological analyses.

sessionInfo()

R version 4.3.1 (2023-06-16) Platform: x86_64-apple-darwin20 (64-bit) Running under: macOS Monterey 12.6.7

Matrix products: default BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib LAPACK: /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/lib/libRlapack.dylib; LAPACK version 3.11.0

locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: Europe/Madrid tzcode source: internal

attached base packages: [1] stats graphics grDevices datasets utils methods base

other attached packages: [1] ggcorrplot_0.1.4.1 lubridate_1.9.3 forcats_1.0.0 stringr_1.5.0 dplyr_1.1.3 purrr_1.0.2 readr_2.1.4 tidyr_1.3.0
[9] tibble_3.2.1 ggplot2_3.4.4 tidyverse_2.0.0 RUtilpol_0.0.0.9001 RFossilpol_1.0.0 here_1.0.1

loaded via a namespace (and not attached): [1] gtable_0.3.4 remotes_2.4.2.1 tzdb_0.4.0 vctrs_0.6.4 tools_4.3.1 generics_0.1.3 curl_5.1.0 parallel_4.3.1 proxy_0.4-27
[10] fansi_1.0.5 pkgconfig_2.0.3 KernSmooth_2.23-21 checkmate_2.3.0 ggridges_0.5.4 assertthat_0.2.1 lifecycle_1.0.3 compiler_4.3.1 farver_2.1.1
[19] munsell_0.5.0 ggforce_0.4.1 janitor_2.2.0 snakecase_0.11.1 class_7.3-22 usethis_2.2.2 pillar_1.9.0 crayon_1.5.2 MASS_7.3-60
[28] classInt_0.4-10 wk_0.9.0 tidyselect_1.2.0 stringi_1.7.12 sf_1.0-14 polyclip_1.10-6 rprojroot_2.0.3 grid_4.3.1 colorspace_2.1-0
[37] cli_3.6.1 Bchron_4.7.6 magrittr_2.0.3 utf8_1.2.4 e1071_1.7-13 withr_2.5.1 waldo_0.5.1 scales_1.2.1 backports_1.4.1
[46] bit64_4.0.5 timechange_0.2.0 httr_1.4.7 bit_4.0.5 hms_1.1.3 s2_1.1.4 rlang_1.1.1 Rcpp_1.0.11 glue_1.6.2
[55] DBI_1.1.3 tweenr_2.0.2 renv_1.0.0 rstudioapi_0.15.0 vroom_1.6.4 jsonlite_1.8.7 R6_2.5.1 units_0.8-4 fs_1.6.3

OndrejMottl commented 10 months ago

Hi @xbenitogranell,

Thank you for your patience with my response.

I have successfully replicated your bug and it seems that it is a known issue with the {sf} package (see the list of known issues with s2 as geometry engine here)

A very simple temporary workaround is to turn off s2 before running the script:

sf::sf_use_s2(FALSE)

I have started a discussion thread about this and I will keep you posted if there is any better solution.