[R-sig-Geo] classify point by nearest polygon
Rolf Turner
r.turner at auckland.ac.nz
Sun Feb 13 22:50:50 CET 2011
On 13/02/2011, at 11:07 AM, Corey Chivers wrote:
> I have a large number of points which I would like to associate with
> either the polygon (in my case, lake) they are in or nearest to. I
> have
> succeeded in classifying the points which are actually in a polygon
> using overlay(). I have scoured around looking for a solution to
> identifying the nearest neighbor polygon of a point but have not found
> an elegant solution.
>
> There was a thread about this issue back in 2009 ([R-sig-Geo] Finding
> the county shapefile polygon closest to along-lat position), but I was
> unable to implement the suggested workaround and wonder if there
> isn't a
> better solution known out there.
>
> Thank you in advance for any help/advice you can provide!
There are tools in the spatstat package that will let you accomplish
your objective quite easily. A little bit of ``fitting together'' of
these tools is required.
Let me know if you are interested and I can give you detailed
instructions
as to how to do the fitting together.
cheers,
Rolf Turner
More information about the R-sig-Geo
mailing list