Skip to content
Prev 1854 / 29559 Next

line segments of boundaries

On Wed, 14 Mar 2007, Edzer J. Pebesma wrote:

            
poly2nb() in spdep only finds *polygons* sharing one/two boundary points,
it does not do the topology by breaking the polygons into arcs and nodes.  

If you need the topology, I suggest that you establish a GRASS location,
read the vector polygons into GRASS 6, best 6.3 CVS, which will build the
topology - it may need cleaning and repair - then look at vect2neigh() in 
the spgrass6 package. This does most of what is needed to retrieve IDs of 
neighbouring polygons, and the length of their boundaries. If I recall 
correctly, it aggregates multiple boundaries between the same pair of 
polygons, which may not suit your case. The ideas and changes in GRASS 
were made by Markus Neteler.

Roger