remicres/otb-mosaic

error running mosaic with testdata

Closed this issue · 2 comments

error from qgis:

mosaic_error_qgis

Full log from qgis processing:

Processing algorithm…
Algorithm 'Mosaic' starting…
Input parameters:
{ 'il' : ['C:/Users/admin/Desktop/qgis-data/mosaic/SP67_FR_subset_1.tif','C:/Users/admin/Desktop/qgis-data/mosaic/SP67_FR_subset_2.tif'], 'vdcut' : '', 'vdstats' : '', 'comp.feather' : 'large', 'harmo.method' : 'none', 'harmo.cost' : 'rmse', 'out' : 'C:/Users/admin/AppData/Local/Temp/processing_b50134da5e0b46568874c7afe40d9d90/c9a94f2d6d9142118b9f47578d4235ef/out.tif', 'interpolator' : 'nn', 'output.spacing' : 0, 'tmpdir' : '', 'distancemap.sr' : 10 }


C:\PROGRA~1\QGIS3~1.2\bin>SET LC_NUMERIC=C

C:\PROGRA~1\QGIS3~1.2\bin>SET GDAL_DRIVER_PATH=disable

C:\PROGRA~1\QGIS3~1.2\bin>SET "GDAL_DATA=C:\Users\admin\Desktop\OTB-6.6.0-Win64\share\data"

C:\PROGRA~1\QGIS3~1.2\bin>SET "GEOTIFF_CSV=C:\Users\admin\Desktop\OTB-6.6.0-Win64\share\epsg_csv"

C:\PROGRA~1\QGIS3~1.2\bin>SET "OTB_APPLICATION_PATH=C:\Users\admin\Desktop\OTB-6.6.0-Win64\lib\otb\applications"

C:\PROGRA~1\QGIS3~1.2\bin>"C:\Users\admin\Desktop\OTB-6.6.0-Win64\bin\otbApplicationLauncherCommandLine.exe" Mosaic C:/Users/admin/Desktop/OTB-6.6.0-Win64/lib/otb/applications -comp.feather "large" -distancemap.sr "10.0" -harmo.cost "rmse" -harmo.method "none" -il "C:\Users\admin\Desktop\qgis-data\mosaic\SP67_FR_subset_1.tif" "C:\Users\admin\Desktop\qgis-data\mosaic\SP67_FR_subset_2.tif" -interpolator "nn" -out "C:/Users/admin/AppData/Local/Temp/processing_b50134da5e0b46568874c7afe40d9d90/c9a94f2d6d9142118b9f47578d4235ef/out.tif"
2018-07-05 15:37:36 (INFO): Default RAM limit for OTB is 128 MB
2018-07-05 15:37:36 (INFO): GDAL maximum cache size is 614 MB
2018-07-05 15:37:36 (INFO): OTB will use at most 12 threads
2018-07-05 15:37:37 (INFO): No kwl metadata found in file C:\Users\admin\Desktop\qgis-data\mosaic\SP67_FR_subset_1.tif
2018-07-05 15:37:37 (INFO): No kwl metadata found in file C:\Users\admin\Desktop\qgis-data\mosaic\SP67_FR_subset_2.tif
2018-07-05 15:37:37 (INFO): Temporary files prefix is: out
2018-07-05 15:37:37 (INFO): No harmonization method is selected
2018-07-05 15:37:37 (INFO): Computing distance map images...
2018-07-05 15:37:37 (INFO): Estimated memory for full processing: 1.52892MB (avail.: 128 MB), optimal image partitioning: 1 blocks
2018-07-05 15:37:37 (INFO): File out_tmp_binary_mask_0.tif will be written in 1 blocks of 26x31 pixels

Writing binary mask (from image boundaries) out_tmp_binary_mask_0.tif: 100% [**************************************************]ERROR 4: Attempt to create new tiff file `out_tmp_binary_mask_0.tif' failed: Permission denied
2018-07-05 15:37:37 (FATAL): itk::ERROR: GDALImageIO(0000009F7A69F5D0): Attempt to create new tiff file `out_tmp_binary_mask_0.tif' failed: Permission denied
Execution completed in 1.27 seconds
Results:
{}

Loading resulting layers
Algorithm 'Mosaic' finished

I had tried to run command on command line:

"C:\Users\admin\Desktop\OTB-6.6.0-Win64\bin\otbApplicationLauncherCommandLine.exe" Mosaic C:/Users/admin/Desktop/OTB-6.6.0-Win64/lib/otb/applications -comp.feather "large" -distancemap.sr "10.0" -harmo.cost "rmse" -harmo.method "none" -il "C:\Users\admin\Desktop\qgis-data\mosaic\SP67_FR_subset_1.tif" "C:\Users\admin\Desktop\qgis-data\mosaic\SP67_FR_subset_2.tif" -interpolator "linear" -out "C:/Users/admin/Desktop/qgis-data/mosaic.tif" -tmpdir "C:/Users/admin/Desktop/qgis-data/tmp"

Result is "Access denied".
Also tested with a different value for "-out" parameter, no -tmpdir and default -out and -tmpdir values..

mosaic_error_cmd

QGIS version: 3.2
OTB version 6.6.0

HowTo Reproduce:
download otb 6.6.0 win64.zip
install qgis standalone
and configure otb plugin with https://gitlab.orfeo-toolbox.org/orfeotoolbox/qgis-otb-plugin/blob/master/README.md

after re-installing qgis3.2, re-extracting otb files, Mosaic works on qgis Windows
if "a temp directory is set". default or emtpy value for this return error.

Maybe something to do in applications.
https://github.com/remicres/otb-mosaic/blob/master/app/otbMosaic.cxx#L549
MandatoryOff -> MandatoryOn
Or
#if _win32
setParameterdefaultvalue("tmpdir" windows-temp-directory")
#else
setParameterdefaultvalue("tmpdir" "/tmp")
#endif

I would go with mandatoryOn and let user choose their own..

Thanks. I've corrected it in f477679
When the temporary directory is not set, the app uses the path of the output image.