need help with output extacted edges

Michel Wurtz - ENGEES/CEREG mw at engees.u-strasbg.fr
Mon Dec 13 07:06:43 EST 1999


Ning Zhong wrote:
> 
> Hi, Grass Users,
> 
> I have a gif image file depicting some solid regions. I want to get the
> boundary edges of the regions and output the file with only boundary edges
> as an image file(tiff). I used r.poly, and then v.to.rast. But the result
> is still an image with solid regions. Could anyone inform how to get
> an raster image file with only boundaries?
> Thanks in advance,

Yes, Grass make the difference between lines and polygons. You can
transform all polygons to lines the following way :
Once you have a vector file, use v.out.ascii.  You will have a text
file in $LOCATION/dig_ascii.  Edit it and change all "A" to "L" in the
beginning of lines.  Then use v.in.ascii to have again a binary file.
You will probably have to remove the corresponding $LOCATION/dig_att file,
so v.support will not complain about area labels. You have also to
use v.digit (v.digspline in Grass 5) to bulk label all your lines to 1,
or any other number you will see in boudary edges. Then run v.to.rast.

You can also directly draw a buffer (one pixel wide) around your areas.
or use some edge detecting function (or even program yourselves in
r.mapcalc)

-- 
Michel Wurtz    ENGEES - CEREG
                1, quai Koch - BP 1039, F-67070 STRASBOURG cedex
                Tel: +33 03.88.24.82.45  Fax: +33 03.88.37.04.97



More information about the grass-user mailing list