Have you tried ?spatstats::nearestsegment or ?rgeos::gDistance ?

Cheers,
Roman




On Wed, May 25, 2011 at 7:34 PM, Francois Rousseu <
[email protected]> wrote:

>
> Hi useRs
>
> I want to measure the distance between several points on a map and the
> closest water body, represented by polygons. The method I found uses the
> dist2Line function from package geosphere. In my example, I create a
> circular polygon made from a 100 000 points and measure the distance
> separating it from a given point:
>
>  buff<-destPoint( c(-74,46), b=seq(1,365,length.out=100000), d=1000)
> system.time(dist2Line(c(-75,45), buff))
>
> This takes almost 10 seconds on my computer which is way too long for me.
> In my case, I need to determine that distance between thousands of points in
> a complex lake system.  Is there a faster way to do this in R?
>
> Thanks
> Francois Rousseu
>
>
>
>        [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> [email protected]
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



-- 
In God we trust, all others bring data.

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Reply via email to