-
Notifications
You must be signed in to change notification settings - Fork 82
Closed
Description
When we're coming from geodataframes, we can probably implement a shared perimeter weighting scheme pretty easily. This means that, instead of contiguity being a binary relation, we'd assign the weight to the adjacency graph according to how much of the polygon's perimeter is shared along their shared edge.
For Queen weights, this would necessarily reduce them down to Rook weights, so we would implement this only for Rook.
- do a first pass for binary contiguity
- for neighbors:
poly_focal.intersection(poly_neighbor).length / poly_focal.boundary.length
would give the asymmetric perimeter weightpoly_focal.intersection(poly_neighbor).length / (poly_focal.boundary.length + poly_neighbor.length)
would give a symmetrized perimeter weight
This would be an interesting addition to the library. It could be implemented as a function in util
, and then applied at the end of initialisation for Rook.from_shapefile
or from_dataframe
if perimeter=True
.
weikang9009