[GIS] How to produce multiple maps with same layout for different layers’ extents

qgis

I have an area which is divided into several zones the borders of which I have defined as separate layers. The layers are defined by sql queries on a postgis table of line segments joined with a table that says which segments are part of which zone boundaries.

What I want to do is produce a set of maps where each map is a zoom to layer extent for each zone and which has standard header, legend and scale (which will preferably vary with the zone but could be fixed across all maps).

My first attempt was to get a new composer for each map — that worked but was rather tedious. Next I tried producing one map and printing it and then deleting the map frame and going into qgis to zoom to the next layer extent and make the boundary visible then hopping back into the composer to load it in. This worked more or less. Map was fine, legend was OK because it was the same for all the maps and the zone name was easy to edit but the scale needed to be deleted and set up again for each map.

Next I looked at Atlas Generation. The manual seems to assume that you know how it works and all you need is a reminder about the details (like so many software manuals 😉 It seems to assume that you have something that you are iterating over but I can't see how to make it work — there is nothing to iterate over to get the layers.

Any suggestions welcome!! 🙂

Russell

Best Answer

In QGIS 2.2 (or now in nightly builds) there is a feature that allows you to highlight the current feature. This can be used to mask the other zones out as you iterate over them. You can't really hide the other features but you can use this to create a black out layer which might look a bit ugly but will have the same effect.

What you need is:

  • Nightly QGIS, or 2.2 when it's released
  • A layer with each zone as polygons
  • A composer layout

I only have suburbs so I'll just use that for the example but you'll get the idea

Create your composer layout and enable the Atlas feature, selecting your zones layer:

enter image description here

If you add an label with text like:

Current Zone: [% "ZoneName" %]

It will fill in the current zones name. Tip: Anything inside [% %] is an expression.

Switch back to your map and use the rule based rendering style on your zone

enter image description here

$id =  $currentfeature 

Is the rule to style the current active atlas feature. e.g the id of the check feature is the same as the atlas feature. Make sure this layer is right at the top so it hides the others

The ELSE rule is everything else (new in 2.2). Apply the style

enter image description here

Jump back into the print composer and print a run off your maps.

This will be the result

enter image description here

With some setup you can do little insert maps, etc, with this new feature

enter image description here