[Qgis-user] question regarding linking Algorithms in Graphical Modeler
Albury, Carl -FS
calbury at fs.fed.us
Tue Oct 21 14:39:20 PDT 2014
Hi, I'm running QGIS 2.4.0-Chugiak on a Windows & machine, and I'm new to QGIS.
I'm trying run a model that has three algorithms, two of which are run in "parallel" and a third that uses the outputs from form the first two. I specified that that third The first algorithm runs fine but when it gets to the second it bombs with the message:
C:\PROGRA~1\QGISCH~1\bin>exit
Converting outputs
Outputs: outfile =E:/temp/PreNBR7.tif
OK. Execution took 49.503 ms (1 outputs).
Prepare algorithm 1: r.mapcalculator - Calculate new raster map from a r.mapcalc expression.
[Errno 9] Bad file descriptor See log for more details
The three pieces work fine when broken into separate models but I would like to have the whole thing run in one go..
I exported to a script (below) and have attached the model.
##test_dnbr=name
##rasterlayer_prenir=raster
##rasterlayer_preswir=raster
##rasterlayer_postnir=raster
##rasterlayer_postswir=raster
##outfile_alg0=output raster
##outfile_alg1=output raster
##outfile_alg2=output raster
outputs_0=processing.runalg("grass:r.mapcalculator", rasterlayer_prenir, rasterlayer_preswir, None, None, None, None, if((A+B)==0,0,1000*(A-B)/(A+B)), None, 0.0, outfile_alg0)
outputs_1=processing.runalg("grass:r.mapcalculator", rasterlayer_postnir, rasterlayer_postswir, None, None, None, None, if((A+B)==0,0,1000*(A-B)/(A+B)), None, 0.0, outfile_alg1)
outputs_2=processing.runalg("grass:r.mapcalculator", outputs_0['outfile'], outputs_1['outfile'], None, None, None, None, A-B, None, 0.0, outfile_alg2)
Any suggestions are welcome,
Carl Albury
Remote Sensing Specialist
RedCastle Resources, Inc.
Working onsite at:
USDA Forest Service
Remote Sensing Applications Center (RSAC)
2222 West 2300 South
Salt Lake City, UT 84119
Office: (801) 975-3351
Mobile: (505) 231-3179
Email: calbury at fs.fed.us
RSAC FS Intranet website: http://fsweb.rsac.fs.fed.us/
RSAC FS Internet website: http://www.fs.fed.us/eng/rsac/
Log:
ALGORITHM|Tue Oct 21 2014 15:31:30|processing.runalg("modeler:dnbr_test","Z:/Projects/Mekong/imagery/LT50340372011287/LT50340372011287PAC01_toa_band4.tif","Z:/Projects/Mekong/imagery/LT50340372011287/LT50340372011287PAC01_toa_band7.tif","Z:/Projects/Mekong/imagery/LE70340372013268/LE70340372013268EDC00_toa_band4.tif","Z:/Projects/Mekong/imagery/LE70340372013268/LE70340372013268EDC00_toa_band7.tif","E:/temp/PreNBR8.tif","E:/temp/PostNBR8.tif","E:/temp/dNBR8.tif")
ERROR|Tue Oct 21 2014 15:32:23|Uncaught error while executing algorithm|Traceback (most recent call last):|Traceback (most recent call last):| File "C:/PROGRA~1/QGISCH~1/apps/qgis/./python/plugins\processing\core\GeoAlgorithm.py", line 217, in execute| self.processAlgorithm(progress)| File "C:/PROGRA~1/QGISCH~1/apps/qgis/./python/plugins\processing\modeler\ModelerAlgorithm.py", line 607, in processAlgorithm| self.prepareAlgorithm(alg, iAlg)| File "C:/PROGRA~1/QGISCH~1/apps/qgis/./python/plugins\processing\modeler\ModelerAlgorithm.py", line 499, in prepareAlgorithm| value = self.getMinCoveringExtent()| File "C:/PROGRA~1/QGISCH~1/apps/qgis/./python/plugins\processing\modeler\ModelerAlgorithm.py", line 545, in getMinCoveringExtent| layer = dataobjects.getObjectFromUri(param.value)| File "C:/PROGRA~1/QGISCH~1/apps/qgis/./python/plugins\processing\tools\dataobjects.py", line 215, in getObjectFromUri| print _loadedLayers|IOError: [Errno 9] Bad file descriptor|
ERROR|Tue Oct 21 2014 15:33:38|Could not load script: C:/PROGRA~1/QGISCH~1/apps/qgis/./python/plugins\processing\script\scripts\Split_vector_layer_by_attribute.py|Problem with line: ##output=output file|
ERROR|Tue Oct 21 2014 15:33:38|Could not load model notinorder.model|Error in algorithm name: saga:catchmentareaparallel
ERROR|Tue Oct 21 2014 15:33:38|Could not load model watersheds.model|Error in algorithm name: saga:catchmentareaparallel
ERROR|Tue Oct 21 2014 15:33:38|Could not load model notinorder.model|Error in algorithm name: saga:catchmentareaparallel
ERROR|Tue Oct 21 2014 15:33:38|Could not load model watersheds.model|Error in algorithm name: saga:catchmentareaparallel
ERROR|Tue Oct 21 2014 15:33:49|Could not load script: C:/PROGRA~1/QGISCH~1/apps/qgis/./python/plugins\processing\script\scripts\Split_vector_layer_by_attribute.py|Problem with line: ##output=output file|
ERROR|Tue Oct 21 2014 15:33:49|Could not load model notinorder.model|Error in algorithm name: saga:catchmentareaparallel
ERROR|Tue Oct 21 2014 15:33:49|Could not load model watersheds.model|Error in algorithm name: saga:catchmentareaparallel
ERROR|Tue Oct 21 2014 15:33:49|Could not load model notinorder.model|Error in algorithm name: saga:catchmentareaparallel
ERROR|Tue Oct 21 2014 15:33:49|Could not load model watersheds.model|Error in algorithm name: saga:catchmentareaparallel
ERROR|Tue Oct 21 2014 15:34:00|Could not load script: C:/PROGRA~1/QGISCH~1/apps/qgis/./python/plugins\processing\script\scripts\Split_vector_layer_by_attribute.py|Problem with line: ##output=output file|
ERROR|Tue Oct 21 2014 15:34:00|Could not load model notinorder.model|Error in algorithm name: saga:catchmentareaparallel
ERROR|Tue Oct 21 2014 15:34:00|Could not load model watersheds.model|Error in algorithm name: saga:catchmentareaparallel
ERROR|Tue Oct 21 2014 15:34:01|Could not load model notinorder.model|Error in algorithm name: saga:catchmentareaparallel
ERROR|Tue Oct 21 2014 15:34:01|Could not load model watersheds.model|Error in algorithm name: saga:catchmentareaparallel
This electronic message contains information generated by the USDA solely for the intended recipients. Any unauthorized interception of this message or the use or disclosure of the information it contains may violate the law and subject the violator to civil or criminal penalties. If you believe you have received this message in error, please notify the sender and delete the email immediately.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dnbr_test.model
Type: application/octet-stream
Size: 1354 bytes
Desc: dnbr_test.model
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20141021/9d273999/attachment.obj>
More information about the Qgis-user
mailing list