Skip to content

Can you query points with a polygon?

3 messages · Mulholland, Tom, Christoph Hofer, Edzer Pebesma

#
Yes there is more than one. I can't remember when I made the decision but I recall doing some speed tests and I picked inside.owin in the spatstat package. I think splancs and spatial might have their own versions as well. The overlay function in sp works. I think I found this too slow for what I was doing at the time. I haven't revisited this recently so it may be worth your while checking out the variations.

Tom
#
Hello Kenneth

In the sp package you find the function "point.in.polygon".


Christoph


Am 13.12.2006 um 06:24 schrieb Mulholland, Tom:
#
Christoph Hofer wrote:
Yes, and a convenient wrapper method, called "overlay" which basically 
overlays a polygon coverage (SpatialPolygonsDataFrame) with a point 
coverage (SpatialPointsDataFrame). Try

 > library(sp)
 > ?overlay
 > methods?overlay

--
Edzer