Skip to content
Prev 15317 / 29559 Next

calculating shortest distance from a set of SpatialPoints to a polygon

Dear Roger and Simon,

Thanks very much for the suggestions. I got both the gDistance and nncross options to work (after learning rather more about projections and their use in R), and they're producing identical, sensible results. Interestingly, nncross is faster than gDistance, and both are way faster than dist2Line (which produces very similar though not identical results).

I think my main problem was understanding projections, how to use proj4string, and cluing in that "+proj=utm" is projected whereas "+proj=longlat" isn't! Rather new material for me.

Cheers,
Malcolm
On 13 Jun 2012, at 14:22, Roger Bivand wrote: