Frank, this is lovely. Does the GDALPolygonize function handle interior rings in polygons, i.e. creating a donut polygon for an area of pixels with common values which has a hole in it? We would like to use it for classification work, but often end up creating quite complex geometries in the raster.<br>
<br><div class="gmail_quote">On Sun, Mar 15, 2009 at 10:50 PM, Frank Warmerdam <span dir="ltr"><<a href="mailto:warmerdam@pobox.com">warmerdam@pobox.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">Micha³ Krzywda wrote:<br>
> Hi all,<br>
><br>
> I would like to convert raster file to vector format for instance PNG to GML.<br>
> I know it's hard to do it, and result might not be brilliant, but I would like to try.<br>
><br>
> Among all articles and FAQ's I have found:<br>
> <a href="http://trac.osgeo.org/gdal/wiki/FAQRaster#Howtoconvertarastertoalayerofpolygons" target="_blank">http://trac.osgeo.org/gdal/wiki/FAQRaster#Howtoconvertarastertoalayerofpolygons</a><br>
><br>
> Is there any resource how to perform such conversion?<br>
> Which tools I need use to perform transformation, assuming that I'm starting with ordinary PNG file.<br>
<br>
</div>Micha³,<br>
<br>
I have updated the FAQ to reference the new (in 1.6) gdal_polygonize.py<br>
python script. Unfortunately, it depends on the "next generation" bindings<br>
which are not available in FWTools. You can either build GDAL 1.6 or<br>
trunk from source, or use an existing binary build that does include<br>
the (default) next generation bindings such as OSGeo4W<br>
(<a href="http://osgeo4w.osgeo.org" target="_blank">http://osgeo4w.osgeo.org</a>).<br>
<br>
If you were to use OSGeo4W you would need to install the "gdal16"<br>
package as well as "gdal16-python". Then in the OSGeo4W Command Shell<br>
you would do something like:<br>
<br>
gdal16<br>
gdal_polygonize src.png -f GML out.gml<br>
<br>
Best regards,<br>
<font color="#888888">--<br>
---------------------------------------+--------------------------------------<br>
I set the clouds in motion - turn up | Frank Warmerdam, <a href="mailto:warmerdam@pobox.com">warmerdam@pobox.com</a><br>
light and sound - activate the windows | <a href="http://pobox.com/%7Ewarmerdam" target="_blank">http://pobox.com/~warmerdam</a><br>
and watch the world go round - Rush | Geospatial Programmer for Rent<br>
</font><div><div></div><div class="h5"><br>
_______________________________________________<br>
FWTools mailing list<br>
<a href="mailto:FWTools@lists.maptools.org">FWTools@lists.maptools.org</a><br>
<a href="http://lists.maptools.org/mailman/listinfo/fwtools" target="_blank">http://lists.maptools.org/mailman/listinfo/fwtools</a><br>
<a href="http://fwtools.maptools.org/" target="_blank">http://fwtools.maptools.org/</a><br>
</div></div></blockquote></div><br>