Open Solivetti opened 1 year ago
Dear Luigi,
by passing through the first error log (AttributeError: 'Point' object has no attribute 'centroid') it seems your dataset has some geometry which is not a polygon. Can you try to run the plugin with this dataset which I am sure has polygon geometries which can be handled by the PySAL function in the object?
The second log may be due to bad formatting of the input file (https://docs.python.org/3/library/struct.html). Try to check/change the encoding of the shapefile or leave only the numerical field in the attribute table.
Best,
Daniele
Good evening, I have carried out some further experiments in order to understand the origin of the abovementioned errors. I discovered that the errors do not seem to depend on the geometry of the layer containing the count field or on any other feature of the said layer. Indeed, the errors would disappear by loading up the same layer into a different project. I have assumed that the problem was (and still is) in the original project. This project contains many layers. Therefore, the errors might be caused by the presence of several other layers, although I did not activate them when I tried to run Hotspot. Was it a problem of RAM? There are a few facts in conflict with this hypothesis: firstly, the amount of the PC’s RAM is substantial (32GB) and the PC was using ~26% of its memory at the time of the attempt; secondly, there was no mention of a problem of RAM; thirdly, as I said before, I did not activate the other layers. Ultimately, I have made little progress in my search for the origin of the errors. Anyway, I thank you very much for your attention. Luigi M. Solivetti
Dear Luigi,
I would exclude any problem with RAM. However, it is difficult to replicate the error locally. If you are willing to share (privately) the input shapefile which generates this error, I can try to run some tests on a clean QGIS/Python env. to i) understand if the problem arises from the layer listing function of the plugin that interacts with the layer panel or ii) if the problem is in connected to some features of the input shapefile using directly PySAL from the console.
Best, Daniele
Good morning, I have used the Hotspot plugin several times with satisfying results. Recently, I tried to use the Hotspot plugin within a QGIS project including many layers and I met with this warning, which pops up as soon as I click on the Hotspot icon, and therefore even before trying to fill the Hotspot window. The shapefile with grid & count is top of the list. The count field does not contain null cases. QGIS version is 3.28.11. RAM is 32 Giga. I found that the warning is associated with this specific project. Indeed, I started a new project with only the basic layers of the previous project, saved it and started again QGIS: the problem is over. I am asking myself however which is the cause of the trouble and whether is it possible to find a solution less “manual”. 2023-10-15T17:47:18 WARNING Traceback (most recent call last): File "C:\Users\solivetti\AppData\Roaming\Python\Python39\site-packages\pysal\lib\weights\util.py", line 1028, in get_points_array data = np.vstack([np.array(shape.centroid) for shape in iterable]) File "C:\Users\solivetti\AppData\Roaming\Python\Python39\site-packages\pysal\lib\weights\util.py", line 1028, in data = np.vstack([np.array(shape.centroid) for shape in iterable]) AttributeError: 'Point' object has no attribute 'centroid'
Thanks for your attention, Luigi M. Solivetti Sapienza University of Rome