[GIS] How do dissolve polygons from shapefile using open source tools

dissolvegeojsonopen-source-gisshapefile

In my current project I'm visualizing data on a map representing some values for each administrative areas of a country. I'm given a shapefile of this country, which I'm converting to GeoJSON for use with PolyMaps. Now I've got a requirement to cluster multiple areas into bigger ones, since there is no data for some of the smaller parts, but aggregated data for big ones can be acquired. Those clusters are predefined (e.g. A+B+C=D), so I figured it would be easier to produce a clustered shapefile and convert that to GeoJSON afterwards.

But how do I create such a cluster, preferably automated and with open-source tools? Any other sensible way is of course welcome too.

Best Answer

You can always use an open-source tool like QGIS to open your shapefile and merge features using the built-in "merge selected features" tool (just select features, click merge, select attributes to inherit to the new merged feature, done).

This of course doesn't make much sense if we're talking about hundreds or thousands of merges. I myself was wondering the other day if it is possible to merge features "by attribute" in QGIS?

EDIT: Ok, I'm stupid, if you have a common attribute for all features you're going to "cluster" (like a province or county name) this would be a case for the dissolve tool. Open your shapefile, choose dissolve (in QGIS it's located at Vector > Geoprocessing Tools > Dissolve), select the column with the above mentioned common name, and start the process. This should hopefully (if I haven't misunderstood you) result in what you were looking for.