In QGIS 2.0.1, is there a way to automatically slice up one shapefile and export it as multiple files using polygons defined in another shapefile?

I have a detailed shapefile that categorizes the land ownership of the entire state of Arizona. (It's called "az_surf_mgmt" on this page.) As a whole, it far exceeds the size and complexity restrictions of KML support in Google Maps. So I want to take that file and chop it into individual counties, or perhaps game management units, as defined by another shapefile obtained elsewhere.

I found an almost identical question, but the accepted answer does not address how this might be done automatically. If the answer requires that I learn Python and PyQGIS, so be it.

  • I'm not sure if QGIS terminology is the same, but ArcGIS calls this operation a Split. – PolyGeo Nov 26 '14 at 6:23
  • is this not a use for Spatial Query. Whereby you want to query what polygons fall within another polygon. – Ger Nov 26 '14 at 13:38

QGIS does have a split function but it splits a shapefile into subsidiaries by attribute not geometry. However, you can still use this in a very simple process. Ensure your counties (or game units) data has a unique id field distinct from your other data. Intersect your shapefile with your counties and then use Vector->Data Management Tools->Split Vector Layer.


Hint: I use 2.14.5.LTR (german gui).

This sound like a two-step analysis for me. First you should do a Join attributes by location (search in the processing toolbox). In your example this would join the county attribute to each feature of your az_surf_mgmt layer. Then with the attributes merged to this layer, you can split it by attribute using the split vector layer tool. For convenience, you might put these together with the graphical modeler.

Join attributes by location:

enter image description here

Split vector layer:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.