Skip to content
Prev 9232 / 29559 Next

How do I use neighbourhood list to recursively merge adjacent polygons

On Tue, 7 Sep 2010, christiaan pauw wrote:

            
Please look at ?n.comp.nb in spdep. This finds the number of separate 
graph components in an nb object, returns the count, and a vector saying 
which observation belongs to which disjoint connected subgraph. If there 
are no contiguities across the streets, you should see each subgraph 
matching your street blocks. Try using the subgraph vector to colour a map 
of the residential polygons, or nodes in a plot of the nb object (see the 
example for n.comp.nb. From there on unionSpatialPolygons() if n.comp.nb() 
makes the classification you need.

Hope this helps,

Roger