[gdal-dev] dissolve shapefiles

Thomas Unternaehrer thomas.unternaehrer at gmail.com
Tue May 4 07:22:59 EDT 2010


I try to get a dissolved shapefile out of a large raster file (Erdas
img) using Python. The raster file contains values from lets say 1 to
100. What I need is a shapefile that contains just five groups where
1-20 get the value 1, 21-40 the value 2 and so on.

What I've done so far are the following steps:
- split the raster file into several pieces using gdal_translate
- run gdal.Polygonize on each part to get shapefiles (dissolved based
on the raster values)
- manipulate the resulting dbf-files to get my described groups (gives
me a new field: fieldGrouped)

Now I need to dissolve the resulting shapefiles based on the new field
fieldGrouped to get smaller shapefiles.

How can I do this using gdal/ogr or any other library? Can I
manipulate the original values in my raster file? GRASS has this
functionality but if I'm right, I need to start GRASS and import the
shapefiles to it (it should be easy to run it on a different machine).
Nice would be a function like gdal.Polygonize. I'm more or less
completely new to GIS at all.
My main goal is to produce tiles for Google Maps.

Any hint or help would be appreciated


More information about the gdal-dev mailing list