danioxoli / HotSpotAnalysis_Plugin

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

hotspot analysis in qgis 3.2: TypeError: 'NoneType' object is not iterable #8

Closed sylvaine31 closed 5 years ago

sylvaine31 commented 5 years ago

Hello, I have troubles with hospot analysis install in qgis 3.2.2. I have install pysal with the python consol (import pysal) and install hospot analysis with the experimental plugin. It seems installed, but when I click on hotspot analysis, I have the following message:

Une erreur est survenue lors de l'éxécution du code Python:

TypeError: 'NoneType' object is not iterable Traceback (most recent call last): File "/home/agon/.local/share/QGIS/QGIS3/profiles/default/python/plugins/HotspotAnalysis/hotspot_analysis.py", line 546, in run layers, layers_shp = self.loadLayerList() TypeError: 'NoneType' object is not iterable

Version de Python : 3.6.5 (default, Apr 1 2018, 05:46:30) [GCC 7.3.0] Version de QGIS : 3.2.2-Bonn Bonn, 2684216

Is there an easy fix?

Sylvaine

danioxoli commented 5 years ago

Dear Sylvaine,

Thank you for your interest. The error is due to the input data. Are you using a virtual layer (e.g. one from a join operation) or a CSV layer? Remember that the plugin works only with a projected shapefile of polygons or point having (at least) a numeric attribute for each geometry in the attribute table. Can you try to run the plugin with one of the test data to verify that my assumption is correct?

Let me know!

Best,

Daniele

sylvaine31 commented 5 years ago

Dear Daniele,

Thank you for your attention. The layer was a csv with numeric data a numeric attribute. Unfortunately, as I had several problem with the 3.2 version, I just downgraded to the 2.8 version of QGIS, so I can't do the test you proposed...

Best regards,

Sylvaine

On 04/09/2018 14:39, DOxoli wrote:

Dear Sylvaine,

Thank you for your interest. The error is due to the input data. Are you using a virtual layer (e.g. one from a join operation) or a CSV layer? Remember that the plugin works only with a projected shapefile of polygons or point having (at least) a numeric attribute for each geometry in the attribute table. Can you try to run the plugin with one of the test data https://github.com/danioxoli/HotSpotAnalysis_Plugin/tree/master/test_data to verify that my assumption is correct?

Let me know!

Best,

Daniele

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/danioxoli/HotSpotAnalysis_Plugin/issues/8#issuecomment-418351621, or mute the thread https://github.com/notifications/unsubscribe-auth/Ao-KHR6qz6STo83MDXyOAGVubCxcXeWgks5uXnSKgaJpZM4WYiQQ.

danioxoli commented 5 years ago

Actually, It's just a matter of saving your CSV file into a shapefile by projecting the points e.g. in the UTM zone of your data (or any other metric CRS). Have a look here.

The above procedure a well as the suggested test data work both on QGIS 3 and 2 versions.

Daniele