[R-sig-Geo] Identifying regions on the boundary
Virgilio Gómez-Rubio
virgilio.gomez at uclm.es
Wed Mar 30 16:16:03 CEST 2011
Barry,
What you propose is what I would do too. Another approach is to display
the adjacency matrix as a graph (i.e., vertices for the "location" of
the country and edges for the connections between them). I would say
that all the countries whose vertex can be surrounded by edges will be
land-locked, so that the remaining countries will be non-landlocked.
In this way you do not have to deal with strange polygons (they might
affect your adjacency matrix though), but I am not sure whether this is
a simpler approach.
Hope this helps,
Virgilio
El mié, 30-03-2011 a las 14:53 +0100, Barry Rowlingson escribió:
> Given a region divided into polygons, how can I find which polygons
> have any edges that are not neighbouring other polygons?
>
> For example, if the region is Africa and the polygons are countries,
> I want to find the land-locked and non-landlocked countries.
>
> My first idea is to create a large rectangle bigger than Africa, and
> cutout from it the country polygons, leaving me with a rectangle with
> an Africa-shaped hole. Then I test each country again to see if it
> shares a border with the hole. If it does, its not land-locked.
>
> I can probably do all this with rgeos, but if I've missed a simpler
> way I'd like to hear it...
>
> Obviously I fear sliver polygons after my previous geometry
> manipulation fun....
>
> Barry
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
More information about the R-sig-Geo
mailing list