[FWTools] Converting raster dataset to vector.

Frank Warmerdam warmerdam at pobox.com
Sun Mar 15 22:50:21 EST 2009


Michał Krzywda wrote:
> Hi all,
> 
> I would like to convert raster file to vector format for instance PNG to GML.
> I know it's hard to do it, and result might not be brilliant, but I would like to try.
> 
> Among all articles and FAQ's I have found:
> http://trac.osgeo.org/gdal/wiki/FAQRaster#Howtoconvertarastertoalayerofpolygons
> 
> Is there any resource how to perform such conversion?
> Which tools I need use to perform transformation, assuming that I'm starting with ordinary PNG file.

Michał,

I have updated the FAQ to reference the new (in 1.6) gdal_polygonize.py
python script.  Unfortunately, it depends on the "next generation" bindings
which are not available in FWTools.  You can either build GDAL 1.6 or
trunk from source, or use an existing binary build that does include
the (default) next generation bindings such as OSGeo4W
(http://osgeo4w.osgeo.org).

If you were to use OSGeo4W you would need to install the "gdal16"
package as well as "gdal16-python".  Then in the OSGeo4W Command Shell
you would do something like:

   gdal16
   gdal_polygonize src.png -f GML out.gml

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the FWTools mailing list