danioxoli / HotSpotAnalysis_Plugin

A QGIS plugin for hotspot analysis
GNU General Public License v3.0
55 stars 12 forks source link

ValueError: Illegal field requested in GetField() #17

Closed hmeleiro closed 5 years ago

hmeleiro commented 5 years ago

I'm trying to calculate Moran's i with Hotspot Analysis plugin and I get this error:

2018-11-01T16:28:42 WARNING Traceback (most recent call last): File "/Users/MELEIRO/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/HotSpotAnalysis_Plugin-qgis3/hotspot_analysis.py", line 572, in run u.append(geometry.GetField(C)) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/osgeo/ogr.py", line 4749, in GetField raise ValueError("Illegal field requested in GetField()") ValueError: Illegal field requested in GetField()

The selected attribute is a field of type Real that I joint from a text delimited layer.

danioxoli commented 5 years ago

The error is due exactly becouse of the join. The attrubute field must belong to the shapefile whereas the join is a virtual operation that does not overwrite the shapefile dbf.

Just save a copy of the shapefile on wich the join is active and use the copy for Moran computation with the plugin.

This should solve the issue!

Best,

Daniele

hmeleiro commented 5 years ago

Thank you!