[R-sig-Geo] connecting subgraphs

Roger Bivand Roger.Bivand at nhh.no
Wed Oct 27 21:20:28 CEST 2010


On Wed, 27 Oct 2010, Yan Boulanger wrote:

>
> Dear Rsig community,
>
> I'm quite new to R-sig. Here's my problem :
>
> I have a set of polygons representing Canada's ecodistricts. Although 
> the great majority of polygons are contiguous, few are "isolated" from 
> the main "polygon mass". I created a nb object using the poly2nb 
> function. When I use the snap function (let say 60 km), it links all 
> polygons together, without leaving unconnected subgraphs. Obviously, 
> this also create additionnal links between polygons that are not 
> "really" contiguous INSIDE a given subgraph. I would like to keep only 
> the additionnal links that connect the subgraphs together using a 
> threshold distance (60 km).
>
> My question is : is it possible to connect subgraphs that are isolated 
> from each other by a certain threshold distance without doing it 
> manually ?

Not with polygon representation at present, although the rgeos package on 
may make it possible to buffer around member polygons in each subgraph to 
identify the closest ones. With centroid representation of the polygons, 
one could first find the members of subgraphs, then check distances. But 
this wouldn't be the same as polygon representation.

Roger

>
> Thanks in advance,
>
> Yan
>
> Yan Boulanger
> Dendrolab - Datation de b?timents patrimoniaux par dendrochronologie
> www.dendrolab.ca
> info at dendrolab.ca
>
>
>
> Universit? du Qu?bec ? Rimouski
> D?partement de Biologie
> Centre d'?tudes nordiques
> 300, all?e des Ursulines
> Rimouski, PQ G5L 3A1
> (418) 723-1986 poste 1482
>
>
>
> 	[[alternative HTML version deleted]]
>
>

-- 
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