Detect islands (of more than 1 areas or polygons) into a cartography
On Fri, 30 Dec 2011, Marc Mar? Dell'Olmo wrote:
Dear all, Anyone knows a function to detect if there are islands into a cartography. I refer to islands with more than one area (or polygons). In other words, I would like to detect how many connected components I have in the graph. On the other hand, I would like to know the ?id? of the areas (or polygons) for each island.
This wasn't easy to grasp. By graph, do you mean the neighbour graph of the Polygons objects in a SpatialPolygons object? Could you use the North Carolina counties data set included in maptools to give an example of your question? You'll find additional information in spdep, see the poly2nb() and n.comp.nb() functions. Roger
Note: I usually use the "readShapePoly " to open the cartography. Thank you very much! Marc
_______________________________________________ R-sig-Geo mailing list R-sig-Geo at r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Roger Bivand Department of Economics, NHH Norwegian School of Economics, Helleveien 30, N-5045 Bergen, Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43 e-mail: Roger.Bivand at nhh.no