I would like to select the polygons of the layer below that do not intersect with any other polygon (within the same layer). How can I do this using QGIS, GRASS, SAGA or R?
Here is an attempt to do this in R. I use
gIntersect and compare the layer with itself. Every polygon intersects with itself, so I then use the row sums to determine if there is only one intersect and select those.
library (rgeos) library(sp) # make some polys data (meuse) coordinates(meuse) <- ~x+y polys <- gBuffer(meuse, width=70, byid=T) plot(polys) intersects <- gIntersects(polys, byid = TRUE) # check if polys intersect polys$ints <- apply(intersects,2,sum) # count how many TRUE intersects polys.nooverlap <- polys[polys$ints == 1,] # select polys with only one intersect plot(polys.nooverlap, add=T, col="red")
(Note that the above does not take into account if polygons are completely contained within another, however those could be found with
You may use v.select in GRASS GIS with "operator=disjoint" - features do not spatially intersect. Note that it requires GRASS GIS been compiled with GEOS support. Just check if "disjoint" is a supported parameter in v.select.
Edit: in case of one map only, check v.to.db and its parameter "sides". It extracts categories of areas on the left and right side of the boundary. Idea: isolated area will not have any common length. For an (un)related workflow, see http://grasswiki.osgeo.org/wiki/Vector_length_of_common_boundaries