Thomas,<br><br>I would start by creating a colour table with each group containing the same shade of grey. This will ease the polygonization by avoiding duplicates. There will be three or four (RGB/RGBA) bands from the colour table but you can just consider one band during polygonization.<br>
<br><br><div class="gmail_quote">On Tue, May 4, 2010 at 4:52 PM, Thomas Unternaehrer <span dir="ltr">&lt;<a href="mailto:thomas.unternaehrer@gmail.com">thomas.unternaehrer@gmail.com</a>&gt;</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;">
Hello,<br>
<br>
I try to get a dissolved shapefile out of a large raster file (Erdas<br>
img) using Python. The raster file contains values from lets say 1 to<br>
100. What I need is a shapefile that contains just five groups where<br>
1-20 get the value 1, 21-40 the value 2 and so on.<br>
<br>
What I&#39;ve done so far are the following steps:<br>
- split the raster file into several pieces using gdal_translate<br>
- run gdal.Polygonize on each part to get shapefiles (dissolved based<br>
on the raster values)<br>
- manipulate the resulting dbf-files to get my described groups (gives<br>
me a new field: fieldGrouped)<br>
<br>
Now I need to dissolve the resulting shapefiles based on the new field<br>
fieldGrouped to get smaller shapefiles.<br>
<br>
How can I do this using gdal/ogr or any other library? Can I<br>
manipulate the original values in my raster file? GRASS has this<br>
functionality but if I&#39;m right, I need to start GRASS and import the<br>
shapefiles to it (it should be easy to run it on a different machine).<br>
Nice would be a function like gdal.Polygonize. I&#39;m more or less<br>
completely new to GIS at all.<br>
My main goal is to produce tiles for Google Maps.<br>
<br>
Any hint or help would be appreciated<br>
<br>
Thomas<br>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Best regards,<br>Chaitanya kumar CH.<br>/tʃaɪθənjə/ /kʊmɑr/ <br>+91-9848167848<br>17.2416N 80.1426E<br>