[Gdal-dev] raster to vector with gdal_contour or other method

Mateusz Loskot mateusz at loskot.net
Thu Apr 19 13:06:35 EDT 2007


Lijian Shi wrote:
> I am trying to use gdal_contour to convert the raster data (.geotiff
> file) into vector data (.shp file). Now I can use this command to
> create the close line. Next step is to transform the geometry types
> from line to polygon. But when the polygon is doughnut shape, the
> boundary of polygon will become two lines and the problem becomes
> very complicated.
> 
> Is there any other method or code to convert the raster data into
> polygon?

Lijian,

I believe you could do it with GRASS.
Unfortunately, I'm not experienced with GRASS (yet) but
you can see if r.to.vect will be suitable.

Another option is to convert raster to polygon using r2v.pl script from:
http://map.hut.fi/PerlForGeoinformatics/examples.html

Cheers
-- 
Mateusz Loskot
http://mateusz.loskot.net



More information about the Gdal-dev mailing list