Skip to content
Prev 5212 / 29559 Next

minimum distance between polygons' edges

arion TAFANI wrote:

            
This is implemented in the package 'spatstat'.

For objects of class "psp" (representing collections of line segments) 
the function pairdist.psp computes the distance between each pair of 
line segments. There is also a function crossdist.psp for comparing two 
sets of line segments.

To convert your data from sp classes (like SpatialPolygons or 
SpatialLines) to the class "psp", see the vignette provided in the 
spatstat package.

Note that the shortest distance between two line segments is not the 
same as the minimum distance between their endpoints. So the other 
solutions which have been suggested will not give the correct answer.

Adrian Baddeley