MathieuChailloux / BioDispersal

QGIS plugin to compute ecolgical continuities
GNU General Public License v3.0
7 stars 1 forks source link

Problem with GRASS #9

Closed katagen closed 4 months ago

katagen commented 4 years ago

Hi, I just test your plugin, until I start the 7th step... The log write this:

[2020-03-30 16:29:45.999116] [info] **** BEGIN : Computing dispersal [2020-03-30 16:29:46.048012] [info] Calling processing algorithm 'gdal:rasterize' [2020-03-30 16:29:46.096949] [info] GDAL command: [2020-03-30 16:29:46.096949] [info] GDAL command output: [2020-03-30 16:29:47.084909] [info] Résultats: {'OUTPUT': 'C:\temp\Biodisperal Evolene\Données de base\FINAL_foret_start.tif'} [2020-03-30 16:29:47.084909] [info] Call to rasterize successful, performed in 1.035900354385376 seconds [2020-03-30 16:29:47.097844] [info] Calling processing algorithm 'grass7:r.cost' [2020-03-30 16:29:47.177631] [warn] Traceback (most recent call last): File "C:/PROGRA~1/QGIS3~1.4/apps/qgis-ltr/./python/plugins\processing\algs\grass7\Grass7Algorithm.py", line 383, in processAlgorithm self.tr('GRASS GIS 7 folder is not configured. Please ' _core.QgsProcessingException: Le répertoire de GRASS GIS 7 n'est pas configuré. Veuillez le configurer avant d'exécuter les algorithmes GRASS GIS 7. [2020-03-30 16:29:47.178628] [warn] Il y a eu des erreurs lors de l’exécution de l’algorithme. [2020-03-30 16:29:47.178628] [warn] Failed to call r.cost : Il y a eu des erreurs lors de l’exécution de l’algorithme. [2020-03-30 16:29:47.183643] [Unexpected error] : Il y a eu des erreurs lors de l’exécution de l’algorithme.

MathieuChailloux commented 4 years ago

Hi, did you launch QGIS with GRASS ? For instance my launcher is called "QGIS Desktop 3.10.3 with GRASS 7.8.1".

You can otherwise configure GRASS repository in QGIS parameters.

katagen commented 4 years ago

Hi, I was able to configure GRASS (with this link). But now I have this:

[2020-03-30 19:00:15.744390] [info] **** BEGIN : Computing dispersal [2020-03-30 19:00:15.793259] [info] Calling processing algorithm 'gdal:rasterize' [2020-03-30 19:00:15.846804] [info] GDAL command: [2020-03-30 19:00:15.847802] [info] GDAL command output: [2020-03-30 19:00:16.509240] [info] Résultats: {'OUTPUT': 'C:\temp\Biodisperal Evolene\Données de base\test_start.tif'} [2020-03-30 19:00:16.509240] [info] Call to rasterize successful, performed in 0.7159810066223145 seconds [2020-03-30 19:00:16.527191] [info] Calling processing algorithm 'grass7:r.cost' [2020-03-30 19:01:20.380893] [warn] ERROR 6: SetColorTable() only supported for Byte or UInt16 bands in TIFF format. [2020-03-30 19:01:29.652516] [info] Résultats: {'output': 'C:\temp\Biodisperal Evolene\Données de base\test_disp_tmp.tif'} [2020-03-30 19:01:29.653531] [info] Call to r.cost successful, performed in 73.12633943557739 seconds [2020-03-30 19:01:29.666479] [info] Calling processing algorithm 'gdal:rastercalculator' [2020-03-30 19:01:29.776584] [info] GDAL command: [2020-03-30 19:01:29.776584] [info] GDAL command output: [2020-03-30 19:01:29.832463] [warn] Traceback (most recent call last): File "C:/PROGRA~1/QGIS3~1.4/apps/qgis-ltr/./python/plugins\processing\algs\gdal\GdalAlgorithm.py", line 134, in processAlgorithm GdalUtils.runGdal(commands, feedback) File "C:/PROGRA~1/QGIS3~1.4/apps/qgis-ltr/./python/plugins\processing\algs\gdal\GdalUtils.py", line 110, in runGdal for line in proc.stdout: File "C:\PROGRA~1\QGIS3~1.4\apps\Python37\lib\codecs.py", line 322, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf-8' codec can't decode byte 0x82 in position 87: invalid start byte [2020-03-30 19:01:29.833457] [warn] Il y a eu des erreurs lors de l’exécution de l’algorithme. [2020-03-30 19:01:29.834430] [warn] Failed to call rastercalculator : Il y a eu des erreurs lors de l’exécution de l’algorithme. [2020-03-30 19:01:29.838419] [Unexpected error] : Il y a eu des erreurs lors de l’exécution de l’algorithme.

katagen commented 4 years ago

I try on MAC and PC, with Qgis 3.10 and Grass 7... Always the same error!?! I have no "strange character" like _éà-__ for exemple. Even in the attribute of my layers.

Thank you for your help!

katagen commented 4 years ago

As information, I also tested with your sample (Bousquet), and I have the same kind of error:

[2020-03-31 09:17:08.357076] [info] Calling processing algorithm 'gdal:rastercalculator' [2020-03-31 09:17:08.432902] [info] GDAL command: [2020-03-31 09:17:08.433900] [info] GDAL command output: [2020-03-31 09:17:08.489781] [warn] Traceback (most recent call last): File "C:/PROGRA~1/QGIS3~1.4/apps/qgis-ltr/./python/plugins\processing\algs\gdal\GdalAlgorithm.py", line 134, in processAlgorithm GdalUtils.runGdal(commands, feedback) File "C:/PROGRA~1/QGIS3~1.4/apps/qgis-ltr/./python/plugins\processing\algs\gdal\GdalUtils.py", line 110, in runGdal for line in proc.stdout: File "C:\PROGRA~1\QGIS3~1.4\apps\Python37\lib\codecs.py", line 322, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf-8' codec can't decode byte 0x82 in position 87: invalid start byte [2020-03-31 09:17:08.490773] [warn] Il y a eu des erreurs lors de l’exécution de l’algorithme. [2020-03-31 09:17:08.491746] [warn] Failed to call rastercalculator : Il y a eu des erreurs lors de l’exécution de l’algorithme. [2020-03-31 09:17:08.499724] [warn] Traceback (most recent call last): File "C:/Users/stoant/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\BioDispersal\algs\BioDispersal_algs.py", line 520, in processAlgorithm context=context,feedback=feedback) File "C:/Users/stoant/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\BioDispersal\qgis_lib_mc\qgsTreatments.py", line 580, in applyRasterCalcMin return applyRasterCalcAB_ABNull(input_a,input_b,output,expr,nodata_val,out_type,context,feedback) File "C:/Users/stoant/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\BioDispersal\qgis_lib_mc\qgsTreatments.py", line 553, in applyRasterCalcAB_ABNull applyProcessingAlg("gdal","rastercalculator",parameters,context,feedback) File "C:/Users/stoant/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\BioDispersal\qgis_lib_mc\qgsTreatments.py", line 150, in applyProcessingAlg raise e File "C:/Users/stoant/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\BioDispersal\qgis_lib_mc\qgsTreatments.py", line 128, in applyProcessingAlg res = processing.run(complete_name,parameters,onFinish=no_post_process,context=context,feedback=feedback) File "C:/PROGRA~1/QGIS3~1.4/apps/qgis-ltr/./python/plugins\processing\tools\general.py", line 105, in run return Processing.runAlgorithm(algOrName, parameters, onFinish, feedback, context) File "C:/PROGRA~1/QGIS3~1.4/apps/qgis-ltr/./python/plugins\processing\core\Processing.py", line 183, in runAlgorithm raise QgsProcessingException(msg) _core.QgsProcessingException: Il y a eu des erreurs lors de l’exécution de l’algorithme. [2020-03-31 09:17:08.500722] [warn] Il y a eu des erreurs lors de l’exécution de l’algorithme. [2020-03-31 09:17:08.500722] [warn] Failed to call weightingbasics : Il y a eu des erreurs lors de l’exécution de l’algorithme. [2020-03-31 09:17:08.505741] [Unexpected error] : Il y a eu des erreurs lors de l’exécution de l’algorithme.

MathieuChailloux commented 4 years ago

Hi, What is your exact version and how did you install QGIS (OSGEO or direct installer) ? This issue already happened, it is caused by QGIS gdal:rastercalculator wrapper on some versions, I haven't got the whole picture yet (same error than issue #7).

Best regards, Mathieu

katagen commented 4 years ago

I installed with OSGEO... I have LTM version! image

MathieuChailloux commented 4 years ago

Still hard to find the source of this tricky bug as I can't reproduce it.

I got it working with several versions including last LTR

2020-03-31_09h53_17

Could you try to :

  1. Launch gdal:rastercalculator from toolbox on a raster layer (to check error comes from here)
  2. Check that last LTR version is well installed (3.10.4)
  3. Uninstall all QGIS versions, download OSGEO installer (even if already downloaded), and reinstall it (by the way you can install launcher with grass configured by selecting package qgis-ltr-grass-plugin7)

If needed, you can send me your file and I will launch last step but this is not a sustainable solution.

Best regards, Mathieu

katagen commented 4 years ago

OK, I re-install everything, with the last version of QGIS (non-LTR)... and it works?!? I don't know why?!? Perhaps due to a problem with python-core? See this

MathieuChailloux commented 4 years ago

This other issue was caused by buggy QGIS installers (see issue #6). This one is specific to rastercalculator and I haven't really figured it out...

So this is OK on your side ? I will close this issue and open a new one for rastercalculator error.

katagen commented 4 years ago

Yes, now it's OK for me! Thanks for everything!