r-spatial / link2GI

Simplify the linking of GIS/RS and CLI tools
https://r-spatial.github.io/link2GI
GNU General Public License v3.0
25 stars 7 forks source link

parseOTBFunction() produces an error #62

Closed konstantinengelmayer closed 6 months ago

konstantinengelmayer commented 6 months ago

Hi,

the parseOTBFunction() produces an error that 'C:\OTB-90~1.0-W\bin\otbcli' coundt be found even though it exist in that exact path.

otb = link2GI::linkOTB()

otb

$pathOTB [1] "C:\OTB-9.0.0-Win64\bin\" $version binDir baseDir otbCmd 1 C:\OTB-9.0.0-Win64\bin\ C:\OTB-9.0.0-Win64 C:\OTB-9.0.0-Win64\bin\otbcli $exist [1] TRUE

pca <- link2GI::parseOTBFunction("DimensionalityReduction", otb)

/usr/bin/env: 'C:\OTB-90~1.0-W\bin\otbcli': No such file or directory /usr/bin/env: 'C:\OTB-90~1.0-W\bin\otbcli': No such file or directory Error in file(con, "r") : cannot open the connection In addition: Warning message: In file(con, "r") : cannot open file 'C:\Users\konst\AppData\Local\Temp\RtmpMpumCV/otb_module_dump.txt': No such file or directory

sessionInfo()

R version 4.3.3 (2024-02-29 ucrt) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 19045)

Matrix products: default

locale: [1] LC_COLLATE=English_Germany.utf8 LC_CTYPE=English_Germany.utf8 LC_MONETARY=English_Germany.utf8 [4] LC_NUMERIC=C LC_TIME=English_Germany.utf8

time zone: Europe/Berlin tzcode source: internal

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

other attached packages: [1] dplyr_1.1.4 sf_1.0-16 terra_1.7-71 raster_3.6-26 sp_2.1-3 tmaptools_3.1-1 tmap_3.3-4
[8] mapview_2.11.2

loaded via a namespace (and not attached): [1] RColorBrewer_1.1-3 rstudioapi_0.16.0 magrittr_2.0.3 fs_1.6.3 vctrs_0.6.5
[6] ROCR_1.0-11 memoise_2.0.1 base64enc_0.1-3 htmltools_0.5.8.1 forcats_1.0.0
[11] leafsync_0.1.0 usethis_2.2.3 pROC_1.18.5 caret_6.0-94 parallelly_1.37.1
[16] KernSmooth_2.23-22 htmlwidgets_1.6.4 plyr_1.8.9 stars_0.6-5 lubridate_1.9.3
[21] cachem_1.0.8 mime_0.12 lifecycle_1.0.4 iterators_1.0.14 pkgconfig_2.0.3
[26] Matrix_1.6-5 R6_2.5.1 fastmap_1.1.1 future_1.33.2 shiny_1.8.1.1
[31] digest_0.6.35 colorspace_2.1-0 leafem_0.2.3 pkgload_1.3.4 crosstalk_1.2.1
[36] lwgeom_0.2-14 fansi_1.0.6 timechange_0.3.0 abind_1.4-5 compiler_4.3.3
[41] proxy_0.4-27 remotes_2.5.0 withr_3.0.0 DBI_1.2.2 rgdal_1.6-7
[46] pkgbuild_1.4.4 R.utils_2.12.3 maps_3.4.2 MASS_7.3-60.0.1 lava_1.8.0
[51] sessioninfo_1.2.2 leaflet_2.2.2 classInt_0.4-10 ModelMetrics_1.2.2.2 tools_4.3.3
[56] units_0.8-5 httpuv_1.6.15 future.apply_1.11.2 nnet_7.3-19 R.oo_1.26.0
[61] glue_1.7.0 satellite_1.0.5 nlme_3.1-164 promises_1.3.0 grid_4.3.3
[66] reshape2_1.4.4 generics_0.1.3 recipes_1.0.10 link2GI_0.5-3 gtable_0.3.4
[71] R.methodsS3_1.8.2 class_7.3-22 data.table_1.15.4 xml2_1.3.6 utf8_1.2.4
[76] foreach_1.5.2 pillar_1.9.0 stringr_1.5.1 pals_1.8 later_1.3.2
[81] splines_4.3.3 lattice_0.22-6 survival_3.5-8 tidyselect_1.2.1 miniUI_0.1.1.1
[86] knitr_1.46 CAST_1.0.0 stats4_4.3.3 xfun_0.43 hardhat_1.3.1
[91] devtools_2.4.5 timeDate_4032.109 sperrorest_3.0.5 stringi_1.8.3 codetools_0.2-20
[96] tibble_3.2.1 cli_3.6.2 rpart_4.1.23 xtable_1.8-4 munsell_0.5.1
[101] roxygen2_7.3.1 dichromat_2.0-0.1 Rcpp_1.0.12 globals_0.16.3 mapproj_1.2.11
[106] png_0.1-8 XML_3.99-0.16.1 parallel_4.3.3 ellipsis_0.3.2 gower_1.0.1
[111] ggplot2_3.5.0 exactextractr_0.10.0 profvis_0.3.8 urlchecker_1.0.1 envimaR_0.1.0
[116] listenv_0.9.1 viridisLite_0.4.2 ipred_0.9-14 scales_1.3.0 prodlim_2023.08.28
[121] e1071_1.7-14 purrr_1.0.2 rlang_1.1.3

gisma commented 6 months ago

Hi thanks for reporting.

I think it will be an side effect of the utils function shortPathName which should standarize in a brute force manner the windos path name. Obviously the correct pasting of `otb_module_dump.txt' to this path is not working.

I can not reproduce this under Linux. So I Will check it asap under Windows.

gisma commented 6 months ago

Please check if it work out now.

konstantinengelmayer commented 6 months ago

Yes, now it's working. Thank you.