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

error with OTB 8.1.0 install on linux jammy with R command ? #57

Closed pobsteta closed 1 year ago

pobsteta commented 2 years ago

Hi,

I have install OTB 8.1.0 on my computer in home directory. When i use this command on R :

# link to the installed OTB
otblink <- link2GI::linkOTB(searchLocation = "/home/name/OTB-8.1.0-Linux64/")

if (otblink$exist) {
  ## parse all modules
  algos <- parseOTBAlgorithms(gili = otblink)

  ## take edge detection
  cmdList <- parseOTBFunction(algo = algos[9], gili = otblink)
  ## print the current command
  print(cmdList)
}

i obtain this error :+1:

Erreur dans sapply(args, "[", 4)[[j]] : 
  tentative de sélection de moins d'un élément dans integerOneIndex
gisma commented 2 years ago

@pobsteta sorry for the late answer. I am aware of the problem and working on stable a solution.

gisma commented 2 years ago

@pobsteta pls check if it works

pobsteta commented 2 years ago

Hi,

I reinstall link2GI and have the same error on OTB 8.1 ?

gisma commented 2 years ago

Uh pls wait I oboiusly pushed the wrong version...

pobsteta commented 2 years ago

Hi,

No i have a different error :

cmdList<-parseOTBFunction(algo = algos[27],gili = otblink) Erreur dans dirname(path_OTB) : un argument de type vecteur de caractères est attendu

pobsteta commented 2 years ago

There is an error in function linkOTB: the value off pathOTB does /home/pascal/OTB-8.1.0-Linux64/ not /home/pascal/OTB-8.1.0-Linux64/bin !

pobsteta commented 2 years ago

i look your function "parseOTBFunction" and it's ok if line 20, you change like this : system(paste0("env -i ", path_OTB, "otbcli ", algo, " -help >> ", file.path(R.utils::getAbsolutePath(tempdir()), paste0("otb_module_dump.txt 2>&1"))))

gisma commented 2 years ago

sorry for the late reply. Thanks for the suggestion this is more elegant and also stable I think. please check again...