[GRASSLIST:5186] Re: Converting polygon maps to graphs

Radim Blazek blazek at itc.it
Sat Dec 18 02:53:42 EST 2004


swlab wrote:
> Hello,
> I have a vector map of polygons, and I'd like to transform it as a graph (ie, 
> each polygon centroid would be a node, 2 nodes would be connected if the 
> polygons they represent share a common boundary...)
> Is there any simple way to do it with GRASS57 ? If not, could anybody point me 
> to some online resources ? I'm sure that some algorithms exist already, but 
> I've no idea on how to find them. I'm quite willing to work with shapelibs if 
> needed, but then again, I don't really know where to start.
> 
> Thanks a lot for any idea
> 
> Cheers
> P.

You can get list of adjacent areas using v.to.db option=sides
then write a script.

Radim




More information about the grass-user mailing list