nextgis / qgis_molusce

Modules for Land Use Change Simulations
https://github.com/nextgis/molusce
GNU General Public License v2.0
43 stars 15 forks source link

Error updating tables when there is only one land use class in input raster #11

Closed dnavarrocueto closed 8 years ago

dnavarrocueto commented 8 years ago

Hi.

I have two very big land use raster. I can 'update tables' in the 'area changes' tab but it takes too long to do the simulations. Then I clipped the rasters to speed it up, but I get the following error when I click 'update tables':

Ha ocurrido un error mientras se ejecutaba el código de Python:

Traceback (most recent call last): File "/Users/dani/.qgis2/python/plugins/molusce/moluscedialog.py", line 413, in updateStatisticsTableDone self.drawTransitionStat() File "/Users/dani/.qgis2/python/plugins/molusce/moluscedialog.py", line 1027, in drawTransitionStat stat = self.inputs["crosstab"].getTransitionStat() File "/Users/dani/.qgis2/python/plugins/molusce/algorithms/models/crosstabs/manager.py", line 91, in getTransitionStat deltas = finalArea - initArea ValueError: operands could not be broadcast together with shapes (30) (29)

Versión de Python: 2.7.10 (default, Oct 23 2015, 18:05:06) [GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)]

Versión de QGIS: 2.8.1-Wien Wien,

Ruta de Python: ['/Applications/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing', '/Users/dani/.qgis2/python/plugins/esstoolkit/external', '/Applications/QGIS.app/Contents/MacOS/../Resources/python', u'/Users/dani/.qgis2/python', u'/Users/dani/.qgis2/python/plugins', '/Applications/QGIS.app/Contents/MacOS/../Resources/python/plugins', '/Library/Frameworks/SQLite3.framework/Versions/C/Python/2.7', '/Library/Frameworks/GEOS.framework/Versions/3/Python/2.7', '/Library/Python/2.7/site-packages/numpy-override', '/Library/Python/2.7/site-packages/matplotlib-override', '/Library/Frameworks/GDAL.framework/Versions/1.11/Python/2.7/site-packages', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', '/Library/Python/2.7/site-packages', u'/Users/dani/.qgis2//python', '/Applications/QGIS.app/Contents/Resources/python/plugins/fTools/tools', '/Users/dani/SIG/proyectos']

dnavarrocueto commented 8 years ago

I fix it. It seems that molusce prompt this error when a land use class is only in one of the map year. I solved it by reclassifying the raster.

simgislab commented 8 years ago

duplicate of #12