RQGIS3 icon indicating copy to clipboard operation
RQGIS3 copied to clipboard

Connecting to OTB

Open ailich opened this issue 5 years ago • 6 comments

The paper on RQGIS mentions the ability to connect with the Orfeo Toolbox. qgis_session_info() shows connections to qgis, gdal grass6, grass7, and saga, but not OTB. Is connecting to OTB currently supported?

ailich avatar Nov 25 '19 20:11 ailich

IIRC OTB was removed from QGIS3?

pat-s avatar Nov 25 '19 23:11 pat-s

@pat-s, it was removed initially, but as of QGIS 3.8, it was added back in. Currently my QGIS installation is located in "C:/OSGEO4W" folder, and the Orfeo toolbox is located in "C:\OTB-7.0.0-Win64."

ailich avatar Nov 26 '19 16:11 ailich

Thanks for the heads up!

AFAIR we removed the support for OTB back then when it was removed. Should be an easy one to add it back in if nothing major has changed meanwhile.

@jannes-m?

pat-s avatar Nov 26 '19 17:11 pat-s

@pat-s cool. Would the OTB folder need to "live" in a specific place and be named a certain way to be detected by RQGIS/RQGIS3?

ailich avatar Nov 26 '19 18:11 ailich

This would only work if OTB is part of the processing toolbox (as it was in QGIS 2) but I think I remember that they wanted to add other 3rd party providers as plugins. If this is the case I would rather refrain from adding an additional dependency since (R)QGIS3 is already hard to maintain. Instead I would simply use the command line interface of OTB which you could easily use via system() calls in R. But you can test, if OTB algorithms are available (assuming that you also have installed OTB on your system) by running:

library("RQGIS3")
set_env()
algs = find_algorithms(name_only = TRUE)
# check if otb is among the 3rd party providers
unique(gsub(":.*", "", algs))

jannes-m avatar Nov 26 '19 20:11 jannes-m

@jannes-m OTB does show up in the Processing Toolbox after following the instructions here (see image). However, it does not show up as a 3rd party provider for RQGIS3. It may be related to my setup though because I cannot get RQGIS to find it either even though it appears in the processing toolbar when QGIS2 is open.

Capture

library("RQGIS3")
set_env()
algs = find_algorithms(name_only = TRUE)
# check if otb is among the 3rd party providers
unique(gsub(":.*", "", algs))
[1] "gdal"   "grass7" "native" "qgis"   "saga"  

library("RQGIS")
set_env("C:/Program Files/QGIS 2.18")
algs = find_algorithms(name_only = TRUE)
# check if otb is among the 3rd party providers
unique(gsub(":.*", "", algs))
[1] "taudem"       "modelertools" "qgis"         "grass7"       "lidartools"   "saga"        
[7] "gdalogr"      "gdalorg"      "grass"  

ailich avatar Nov 26 '19 20:11 ailich