clusterpy / clusterpy_qgis_plugin

Clusterpy as a plugin for QGIS
3 stars 3 forks source link

Handle NULL values in threshold attribute column (prev. name: traceback for another error) #34

Closed mattbasinger closed 10 years ago

mattbasinger commented 10 years ago

I received the following error when I opened the plugin:

An error has occured while executing Python code:

Traceback (most recent call last): File "/Users/mattbasinger/.qgis2/python/plugins/clusterpy_light/clusterpy_lightdialog.py", line 91, in updateThresholdLimits maximum += val TypeError: unsupported operand type(s) for +=: 'int' and 'QPyNullVariant'

Python version: 2.7.2 (default, Oct 11 2012, 20:14:37) [GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)]

QGIS version: 2.2.0-Valmiera Valmiera,

Python path: ['/Users/mattbasinger/.qgis2/python/plugins/processing', '/Applications/QGIS.app/Contents/MacOS/../Resources/python', u'/Users/mattbasinger/.qgis2/python', u'/Users/mattbasinger/.qgis2/python/plugins', '/Applications/QGIS.app/Contents/MacOS/../Resources/python/plugins', '/Library/Frameworks/SQLite3.framework/Versions/B/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.10/Python/2.7/site-packages', '/Library/Python/2.7/site-packages/PySAL-1.6.0-py2.7.egg', '/Library/Frameworks/cairo.framework/Versions/1/Python/2.7', '/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', '/Library/Python/2.7/site-packages/PIL', '/Users/mattbasinger/.qgis2/python/plugins/mmqgis/forms', '/Applications/QGIS.app/Contents/Resources/python/plugins/fTools/tools', '/Users/mattbasinger/Desktop/cluster_temp']

sergiobuj commented 10 years ago

Hello Matt, You are getting this error most likely because one (or some) of the columns for the threshold attribute is 'NULL' or empty. There are many ways to fill up those spaces, but that depends on your problem/data. From the plugin perspective, we should handle this situation. I will rename this issue.