Re: aggregate polygons to multipolygons based on an attribute column (shapefile)
On 6/15/05, Bart van den Eijnden <[hidden email]> wrote:
> Hi list,
> is there a tool in the OGR library to aggregate polygons to multipolygons based on an attribute column for shapefiles? Does anybody know how to go about this if it can't be done with OGR?
You could write a python script (or C++ program) to accomplish
this with OGR but there is no built-in capability for this in OGR
command line utilities.
If I were to do it in Python I would read all the features, and maintain
an associative array of geometries in memory to accumulate the
multipolygons, with the attribute value being the key into the array.
This approach assumes that your dataset is small enough that all
the geometry could be held in memory.