ENH: shared perimeter contiguity weighting.
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.lengthwould 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.
this would also provide for proportional voting in lag_categorical
do distance-based weights follow the same logic for area or do they just use centroids?
we have this because @ljwolf added this code to segregation, so should we go ahead and move it here?
@knaaptime any updates on this? I'd say yes, either import it from segregation & expose it here, or contribute the source here as weights.Proportional_Contiguity or something & import that into segregation
imo it would be better to move it here and import into segregation so I'm happy to do that. Are we going to keep the Capital_Underscore convention or should I do lowercase_underscore with an eye toward adopting pep8 naming conventions in the future?
Stale issue message
Hi @knaaptime, this is implemented in Segregation, correct? That implementation needs to be kicked up here, not remain in segregation.
lets move from here into lib asap
xref #507