0

I have a layer containing 200 features (constituencies). There are six regions and there's a variable called REGION in my shapefile too.

I want to filter on a region (by using query builder), and highlight each constituency within that region and save the map (and get 200 maps).

How can I automate generating these 200 maps? Maybe somehow using Atlas Generation? Or a Python script?

I'm using QGIS 2.16.1 - Nodebo.

  • Welcome to gis.stackexchange! Please note that a good question on this site is expected to show some degree of research on your part, i.e. what you have tried and - if applicable - code so far. For more info, you can check our faq. – underdark Jul 15 '17 at 18:26
4

Goal: Changing highlight with semi static mapfocus

As far as i understand your task, you're trying to achieve something like this:

Changing selection with semi stactic view

I took a subset of regions in germany as example and iterated through its sub-regions while keeping the mapfocus on the region. The originally 190 maps were generated via a single atlas export procedure. The GIF shows only a fraction of this maps because of upload limts on SE.



The data i'm using:

Tables of used data Basic visualization of used data

QGIS 2.18.10 on Windows 10 (PC)



The Workflow Summary

  1. First export Regions_Layer as CSV with geometries as Well-Known-Text (WKT)

  2. Join the CSV to the Sub-Regions_Layer (one to many)

  3. Save the Sub-Regions_Layer as CSV without geometries

  4. Add the CSV as textlayer and use the WKT column for geometries

  5. Save the textlayer as shapefile for better performance

  6. The Atlas_Layer has been successfully created, it includes duplicated region geometries for every sub-region feature

  7. Set up the atlas

  8. Set up the symbology of the Sub-Region_layer. Pay extra attention to column name in the function -> it has to be written in single qotes 'column' and not with double qotes "column"

  9. After some final styling and activating the atlas preview in the composer, you're done.



Workflow with images:

  1. First export Regions_Layer as CSV with geometries as Well-Known-Text (WKT)

enter image description here

  1. Join the CSV to the Sub-Regions_Layer (one to many)

enter image description here

  1. Save the Sub-Regions_Layer as CSV without geometries

enter image description here

  1. Add the CSV as textlayer and use the WKT column for geometries

enter image description here

  1. Save the textlayer as shapefile for better performance

enter image description here

  1. The Atlas_Layer has been successfully created, it includes duplicated region geometries for every sub-region feature. Its table looks like this:

enter image description here

  1. Set up the atlas

enter image description here enter image description here

  1. Set up the symbology of the Sub-Region_layer.

Pay extra attention to column name in the function -> it has to be written in single qotes 'column' and not with double qotes "column"

enter image description here

  1. After some final styling and activating the atlas preview in the composer, you're done.


Additional thoughts:

  • Added a scale bar to compensate for the variable map scale

  • Added an overview map for better orientation

  • GIF created via GIMP 2.0

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.