Open darribas opened 8 years ago
Dear Dani, I just tried the following code and it worked:
import clusterpy col = clusterpy.importArcData("clusterpy/data_examples/columbus") col.exportArcData("testOutput/columbus") col.cluster('azpRTabu', ['HOVAL', 'CRIME'], 2, dissolve=1) col.results[0].exportArcData("testOutput/ColDiss")
Juans-iMac:CP juanduque$ python testDissolve.py ClusterPy: Library of spatially constrained clustering algorithms Some functions are not available, reason: No module named Polygon Some functions are not available, reason: No module named Polygon Loading clusterpy/data_examples/columbus.dbf Loading clusterpy/data_examples/columbus.shp Done Writing ESRI files Writing DBF file Done ESRI files created Getting variables Variables successfully extracted Running original AZP-R-Tabu algorithm (Openshaw and Rao, 1995) Number of areas: 49 Number of regions: 2 Constructing regions initial Solution: [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0] initial O.F: 24864.1208571 Performing local search FINAL SOLUTION: [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0] FINAL OF: 24572.9644776 Done Adding variables Done Dissolving lines Done Writing ESRI files Writing DBF file Done ESRI files created Juans-iMac:CP juanduque$
I can't dissolve the shapefile for a solution, am I missing anything? I'm posting here an example using a toy example data (from pysal), but I have not been able to get it to work with other datasets too.
Which prints out the following output: