Skip to content
Prev 21821 / 29559 Next

Shortest distance between points within a polygon

Hi all,

I need to find the distance between two spatial points which lie within 
a polygon, via the shortest path which lies entirely within the polygon. 
Can anyone suggest a method? I need to find something which requires 
minimal computing resources.

I have some examples of the points and polygons here, both in lonlat format:
http://www.met.reading.ac.uk/~jb013101/files/R/datasets/poly.RData 
("poly", a SpatialPolygonsDataFrame)
http://www.met.reading.ac.uk/~jb013101/files/R/datasets/pts.RData 
("pts", a SpatialPoints object)

Many thanks for your help.