示例1,根据字段融合
根据dissolve_field字段融合input.shp,生成output.shp
ogr2ogr output.shp input.shp -dialect sqlite -sql "SELECT ST_Union(geometry), dissolve_field FROM input GROUP BY dissolve_field"
示例2,全部融合
融合所有,不考虑字段
ogr2ogr output.shp input.shp -dialect sqlite -sql "SELECT ST_Union(geometry) FROM input"
参考:
https://gis.stackexchange.com/questions/85028/dissolve-aggregate-polygons-with-ogr2ogr-or-gpc