[R-sig-Geo] polygon adjacency testing

Roger Bivand Roger.Bivand at nhh.no
Wed Aug 18 22:06:15 CEST 2010


On Fri, 13 Aug 2010, Barry Rowlingson wrote:

> On Fri, Aug 13, 2010 at 4:59 PM, Nikhil Kaza <nikhil.list at gmail.com> wrote:
>>
>> I havent looked at poly2nb code, but would eliminating polygons from the
>> polygon list based on area, perimeter  or ratio of these two, before
>> constructing the neighbour list work? This would be similar, not identical,
>> to eliminate in ArcInfo.
>> http://webhelp.esri.com/arcgisdesktop/9.2/index.cfm?TopicName=Eliminate%20%28Data%20Management%29
>
> That's okay for general cleanups of slivers etc, but it wont catch
> other problems that might manifest themselves via adjacency. My
> substantive problem uses polygon adjacency in its model, so I was
> hoping for a way of assessing the correctness of the adjacency graph.
>
> I'm pretty sure I can do it with LinesIntersections from rgeos now,
> its just a bit of a grind to get rid of all the intersections from
> coincident endpoints. nb2lines is also useful.

Barry,

The input shapefile is the one on Lance Waller's website:

http://www.sph.emory.edu/~lwaller/ch9index.htm

which may have been "doctored" to link the Hebrides, Orkney and Shetland 
to the mainland, with unforeseen consequences. poly2nb() should *not* link 
these islands unless they are contiguous! After examination in Saga, 
zooming in close, the slivers do seem to have been "added" to generate 
contiguities for non-contiguous polygons, but that someone's enthusiasm 
has run away with them. Did you try identifying the extraneous slivers, 
seeing if they are duplicated, if so delete the "foreign" one, if not do 
union on them with the contiguous big polygon? They are tiny, so accessing 
the area slot of the Polygon objects should show which is which.

Best wishes,

Roger

>
> Barry
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, 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


More information about the R-sig-Geo mailing list