[GIS] How to merge TopoJSON features

geojsonqgistopojson

I currently have a coordinate based map of the US and it's states for topojson (https://github.com/mbostock/topojson).

The coordinates are a JSON array (as topojson works), data looks like this:

[-123.233256,42.006186], [-122.378853,42.011663]...

Now what I'd like to do is combine states into regions, outside of doing this by hand (and that idea makes me feel sick), are there any tools which I can use to accomplish this?

I have QGIS but have no clue where to even start (let alone how to combine states in QGIS).

Best Answer

You can use topojson.merge to do this, as shown in bl.ocks.org/5416405:

merging states

There are a few limitations to this approach (such as its dependence on an exact topology and lack of detection of holes), but it might for you as-is or with a few adjustments.

There is also the simpler approach of drawing the set of polygons for each region twice, once with a stroke and once with a fill, as shown in bl.ocks.org/5416440:

merging states ii

See also a very similar question on Stack Overflow.