Since QGIS 2.12, with the introduction of data-defined properties on the "lock layers for map" option, in the map item properties, you can do what you seek. You just need to create the right coverage layer, with the information of the extents, but also of the layers to "print".
Create the layer presets
You can "save" the current state (visible or not visible) of your layers as presets. Just create the desired combination and press the eye icon on the layers panel, and choose "add preset".
Basically, you will have to create a preset for each contour, with that layer visible (paired with other layers if you like). This will be your "set of layers".
Give your preset memorable names, or else just opt for some kind of a sequence.
Creating the coverage layer.
Now you will have to create a polygon layer with all the possible combinations between the extents polygons, and all the presets. That means you will end up with some redundancy. You will have to replicate each extent polygon for each preset. Something like this:
polygon 1, preset a
polygon 1, preset b
...
polygon 50, preset a
polygon 50, preset b
You can do this manually with copy paste, or else create some kind of script, but I would say your best and easier way would be using Spatialite or Postgis database. Just import you polygons extents there, and create a new non-spatial table with all presets names. Then, create a view that returns all the combinations.
SELECT f.*, g.preset_name
FROM polygons_extent as f, presets as g
Making it work
Add the new layer or view to QGIS, use it as coverage layer in atlas settings, and use the preset_name attribute in data-defined properties on the "lock layers for map" option.
Best Answer
If the aim is to minimise restructuring of your data I would consider generating a multipoint geometry in a new field to represent the various locations of each respondent. There are many ways to achieve this.
The most efficient approach would probably use Python but here is one very simple method that doesn't require you to create a new file as long as you have a recent version of Excel.
Generate WKT column. Assuming your data is stored with one pair per column as in the screenshot below, generate a new column for the WKT representation of your multiple points using the Excel formula below.
This strips any commas between x and y and replaces them with a space, then concatenates each coordinate pair (skipping empty values) with the correct syntax to generate a WKT string.
Note - you need a fairly recent version of Excel to access the
TEXTJOIN()
function. If you don't have that, OR your data is stored with each x and y coordinate in its own column, look at the bottom of this post.If you are stuck at step 1 above because you don't have that version of Excel, you could try the following:
Alternatively, if your data is stored with each coordinate in its own column, i.e.
x1
,y1
,x2
,y2
, etc. then you can try this expressionSave the CSV with the virtual field as a new layer/csv so that the WKT representation is actually stored in the file and QGIS can detect and load it.
Follow steps 2 and 3 above the line