OGR2OGR Polygon Dissolve – Dissolving/Aggregating Polygons with OGR2OGR or GPC

aggregationogr2ogr

I have a large number of polygons representing the boundaries of US counties which I need to merge into as few polygons as possible.

Is it possible to do this with non-commercial software, or software of a reasonable price?

PostGIS is not available, nor is Java, but C is.

Best Answer

With ogr2ogr (GDAL >= 1.10 with SpatiaLite support):

ogr2ogr output.shp input.shp -dialect sqlite -sql "SELECT ST_Union(geometry), dissolve_field FROM input GROUP BY dissolve_field"
Related Question