[R-sig-Geo] The length of common boundaries
Roger Bivand
Roger.Bivand at nhh.no
Tue Oct 11 15:50:05 CEST 2005
On Tue, 11 Oct 2005, Yilin Liu wrote:
> Dear all,
>
> Any way to get the length of common boundaries shared by neighbouring
> counties in a map in R?
>
The short answer is no. The R polygon objects do not have topology.
The longer answer is that if you have e00 or ArcInfo binary vector layers,
then the polygons are built from lists of directed arcs, and the arcs have
lengths. So if your input data are in this format, it is feasible but is
not implemented.
It looks as though the GRASS6 vector format also provides similar
information. But topology is a GIS thing rather than an R thing, so no
solution within R is available.
If you use GRASS, it would be possible to look at how this might be done
(read a shapefile into GRASS, output an ASCII dump of the arcs, which
polygons they separate, and how long they are, and do something with this,
not losing trace of which polygon(s) belong to which observation - this
was where progress stopped the last time I looked). Arc lengths would be
nice for cartograms too.
Roger
>
> Yilin
>
> _______________________________________________
> 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