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.
--
Soil and Water Laboratory
Dept. of Biological and Environmental Engineering
Cornell University
Riley Robb Hall
ITHACA, NY 14853
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.
On Saturday 18 December 2004 02:53, Radim Blazek wrote:
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...)
You can get list of adjacent areas using v.to.db option=sides
then write a script.
Radim,
Thanks for your answer. Doesn't seem to work in my case, though
(GARSS-5.7.cvs-2004/12/04):
The vector map I use was created from a raster, via
r.to.vect -sv i=RASTER o=VECTOR feat=area
Boundaries created that way don't seem to be recognized properly: for example,
a
'd.vect VECTOR ty=boundary cats=1,6,9'
won't display anything (a
'd.vect VECTOR ty=boundary'
gives proper results, though. It's just that I can't select particular
areas...)
When I run v.to.db, I have a -1|0|0 result, and that's all
I wonder whether I really understood the fundamentals of vector maps. Could
you point me to some info ?
Thx again
P.
--
Soil and Water Laboratory
Dept. of Biological and Environmental Engineering
Cornell University
Riley Robb Hall
ITHACA, NY 14853