select polygons in polygons
Thanks Edzer - I looked into it but I need to coerce the SPDF objects to gpc.poly objects and then I will lose all the attribute data I think. I may just have to use RODBC with postGIS to speed up the selection process, which has worked well for me in other situations, but makes the scripts that much more cumbersome. cheers Murray
Edzer Pebesma wrote:
That's right, it is not there; I thought this morning about a way to look whether all the points of one polygon fall in another, which sp's overlay could do, but that's not a sufficient condition. Perhaps functions in package gpclib can do this? -- Edzer Murray Richardson wrote:
Thanks Friderike. I assumed this was the answer, but it doesn't appear to work with two SPDF objects. i.e.:
overlay(polysA,polysB)
Error in function (classes, fdef, mtable) : unable to find an inherited method for function "overlay", for signature "SpatialPolygonsDataFrame", "SpatialPolygonsDataFrame" Murray Oehler, Friderike (AGPP) wrote:
Try ?overlay Regards, Friderike -----Original Message----- From: r-sig-geo-bounces at stat.math.ethz.ch [mailto:r-sig-geo-bounces at stat.math.ethz.ch] On Behalf Of Murray Richardson Sent: 25 September 2008 06:01 To: r-sig-geo at stat.math.ethz.ch Subject: [R-sig-Geo] select polygons in polygons Hello users, There is probably a very simple solution to this that I am missing: is there a way to select polygons in one SPDF that fall within the polygons of another SPDF? This would save me a lot of processing time as I am having to take a very circuitous route to achieve the same outcome. Thanks! Murray
_______________________________________________ R-sig-Geo mailing list R-sig-Geo at stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo
_______________________________________________ R-sig-Geo mailing list R-sig-Geo at stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo