[GIS] Merge selected features and programming

featuresmergeqgis

I have a shapefile with UK districts and unitary authorities. In the past, using commuting patterns, I worked out a new geography which is close to travel to work areas.

I now would like to create a new shapefile where UK districts and Unitary authorities are merged to create my new map of travel to work areas.
I know it is possible to merge features manually by clicking the "merge selected features" icon. Only it is taking me ages…

Is there a way of programming this?

Is there a way to write some syntax in order to merge features?

That would help a lot, because I will be able to write the program and while I am running it doing something else. Also I would have the syntax saved somewhere.

I am using QGIS version 1.8.0.

Best Answer

I am assuming that you have pre-determined the combinations of admininstrative units that will generate each TTWA equivalent, and that this is in the form of a list like this:

Admin            TTWA
Southampton UA   1
Eastleigh        1
Test Valley      1
Gosport          2
Fareham          2
Portsmouth UA    2

In which case you need to transfer this list to the Admin boundary dataset using an attribute join (if it's not already part of that dataset). Then use the Vector > Geoprocessing Tools > Dissolve command on this dataset, specifying the TTWA attribute as the Dissolve field. This command will merge all admin polygons with the same TTWA value together across the whole dataset.

If you do not have such a pre-determined list of TTWA assignments, then you would need to use zone design techiques to generate TTWAs meeting a set of criteria. A couple of options to consider would be AZTool and PySAL

Related Question