danioxoli / HotSpotAnalysis_Plugin

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

Python Error #14

Closed Claudine95 closed 5 years ago

Claudine95 commented 5 years ago

Hi, I installed the plugin following the instructions, but everytime I try to open it on QGIS 3.2.2 I get this error message:

2018-10-12T19:45:41     WARNING    Traceback (most recent call last):
              File "C:/Users/user/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\HotSpotAnalysis_Plugin-qgis3\hotspot_analysis.py", line 551, in run
              self.load_comboBox()
              File "C:/Users/user/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\HotSpotAnalysis_Plugin-qgis3\hotspot_analysis.py", line 472, in load_comboBox
              thresh = pysal.min_threshold_dist_from_shapefile(path)
              File "C:\PROGRA~1\QGIS3~1.2\apps\Python36\lib\site-packages\pysal\weights\user.py", line 1085, in min_threshold_dist_from_shapefile
              return min_threshold_distance(points, p)
              File "C:\PROGRA~1\QGIS3~1.2\apps\Python36\lib\site-packages\pysal\weights\util.py", line 1142, in min_threshold_distance
              kd = KDTree(data)
              File "C:\PROGRA~1\QGIS3~1.2\apps\Python36\lib\site-packages\pysal\cg\kdtree.py", line 54, in KDTree
              return scipy.spatial.cKDTree(data, leafsize)
              File "scipy\spatial\ckdtree.pyx", line 531, in scipy.spatial.ckdtree.cKDTree.__init__ (scipy\spatial\ckdtree.cxx:5496)
              File "C:\PROGRA~1\QGIS3~1.2\apps\Python36\lib\site-packages\numpy\core\numeric.py", line 620, in ascontiguousarray
              return array(a, dtype, copy=False, order='C', ndmin=1)
             TypeError: float() argument must be a string or a number, not 'Chain'

Any idea on what could be the problem?

Thank you

Claudia

danioxoli commented 5 years ago

Dear Claudia,

It looks like a bad formatting of the input layer you are using. The plugin accepts only shapefiles of points or polygons with at least one numeric attribute at each location.

Are you using an input file like the one I described above? (from the warning seems that you are using an incorrect layer of points)

Best, Daniele

Claudine95 commented 5 years ago

Ok, problem solved. The file had numeric attributes but they weren't listed as numbers, I just had to change the table settings.

Thank you for your help, Claudia