Closed GoogleCodeExporter closed 9 years ago
The following session will produce a knn (k=4) GWT file that is compatible with
OpenGeoda. PySAL however makes the weights as binary while OpenGeoDa assigns
the distance between neighbors as the weight values.
>>> w = pysal.knnW_from_shapefile('baltim.shp', k=4, p=2, idVariable='STATION')
>>> gwt = pysal.open('baltim_PS_4nn.gwt','w')
>>> gwt.varName = 'STATION'
>>> gwt.shpName = 'baltim'
>>> gwt.write(w)
>>> gwt.close()
Original comment by schmi...@gmail.com
on 31 Jul 2010 at 3:01
Original issue reported on code.google.com by
sjsrey
on 31 Jul 2010 at 2:24