[R-sig-Geo] Identifying regions on the boundary

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Wed Mar 30 15:53:50 CEST 2011


 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



More information about the R-sig-Geo mailing list