I'm using QGIS. I have a layer made up of many adjacent polygons - let's call them "countries". I currently use the Atlas plugin to export each "country" polygon to a .png file.

I want to further subdivide each polygon into 3 or more sections (let's call them "states"), and to be able to export these in the same way. However, I want my original polygons ("countries") to remain intact (and hence exportable). Furthermore, if I alter my "country" boundaries, I want the "state" boundaries that are affected to also be automatically updated.

Can anyone advise me on a way I could achieve this?


EDIT: Here's a rough mock-up of my state/country relationships: states and countries

  • how do you want the subdivisions to be made ? With a regular grid ? This lacks detail.
    – Vincent
    Feb 18, 2012 at 17:32
  • I want to subdivide the states into distinct polygons that I define, not automatically.
    – Spinner
    Feb 18, 2012 at 21:39

1 Answer 1


Answer to the question

You want a new dynamic layer based on another given layer.

I would advise the following steps :

  • put your country layer in a database (PostGIS for exemple)
  • create a function (sql/plpgsql) in the database to derive states from a country. This function's complexity depends on the needed method.
  • generate a state table by computing states (with the latter function) for every country. Keep a link between the two layers : the state table will have a country id.
  • put a trigger on the country table which updates the state table, deleting and recreating the states corresponding to a given country whenever this country is modified (deleted/updated/inserted)

You cannot do that directly in QGIS without building a plugin or a specific behaviour with human action.

Further thought - Atlas plugin

If the final intent is to use Atlas plugin to have multiple coverages per country, then this is a behaviour which is planned in a future version of Atlas plugin : coverage generation.

This would include giving a layer of feature and generating coverages from it, with parameters such as scale, number of coverage optimization, regular/irregular grids, coverage rotations…

But this new feature will be developed whenever funding will be given for that.

You can add your own comments to the feature request on Atlas plugin bugtracker :



From the edit and the comment, what the poster seems to do, is editing geometries with a topology.

Basic GIS modelisation relies on «spaghetti model» which are layers of features, which are independant, with their own geometry.

Another way of doing things is to modelize the geometries using a specific topology : the geometries of the features share a common set of canonical entities, which are shared by features. Usually this is done with a node-edge-face model.

QGis does not currently features real topological geometry edition. But here are some hints if you want to go this way :

  • PostGIS 2.0 has a new topology feature set. A QGis plugin is currently developped to support this feature, enabling you to fulfill your needs. Alpha state for the moment, but check http://www.postgis.org

  • semi-topologic editing. There are options in QGIS enabling pseudo-topology when editing geometries : new points of the geometry sit on another feature's shape for example. See «Preferences->snapping options» and the corresponding part in QGIS Manual. This is not full topology editing since modifications to the base geometry are not automatically propagated to the other.

  • Thanks for the answer. Not sure that is exactly what I want to do, however. I will be defining the polygons for each state myslf. I was considering making each set of states (for a specific country) a separate layer, but then changes in the country layer are not reflected in the states. Is there any way to link the layers? As regards Atlas, I'll look at the issue tracker again. Thanks.
    – Spinner
    Feb 18, 2012 at 22:06
  • edited answer to add topology
    – Vincent
    Feb 19, 2012 at 1:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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