1

I am using QGIS 3.8, and I am making a map of archaeological sites. My table looks something like this: NAME - Coordinates X - Coordinates Y - Site_type - Data_type - Century_begin - Century_end

where century_begin is the first century since my data is relevant and century end is the last (e.g. Archaeobotanical analyses only relevant from century 5th to 7th).

I want also to produce now a temporal map, in order to show the sites relevant to each century. E.g. 5th c. (Display sites) 6th c. (Display sites).

Do you know how I can obtain this sort of map?

I tried to use the categorized symbols, but the problem here is that each site has a coverage larger than 1 century (it's always something like 5th-6th).


Solved with help from @csk, but with just one problem. There is a site always showing. This is how my table looks like (It is not editable because I imported it as delimited text - I will Google how to transform it into an editable object).

Table

3
  1. If the "Century_begin" and "Century_end" fields are text columns, convert them to numbers. If they're just the century numbers skip to step 2.

    E.g., if each century is represented by the string 'Xth c.', where X is the century number, use the Field Calculator to store just the century number in a new field. Use this expression to fill the new fields:

     substr("Century_begin", 1, -5)
     substr("Century_end", 1, -5)
    

    example

    Note: the expressions remove the last 5 characters from the Century_begin or Century_end field. Any typos will result in incorrect results, e.g. '15th c' (missing period) will result in a value of 1 instead of 15. Be sure to review your century values and make sure they're correct before proceeding with the next step.

  2. Set up rule-based symbology for your layer, with each rule representing a given century.

    • 1st Century: "Century_begin_num" <= 1 AND "Century_end_num" >= 1
    • 2nd Century: "Century_begin_num" <= 2 AND "Century_end_num" >= 2
    • 3rd Century: "Century_begin_num" <= 3 AND "Century_end_num" >= 3
    • 4th Century: "Century_begin_num" <= 4 AND "Century_end_num" >= 4
    • 5th Century: "Century_begin_num" <= 5 AND "Century_end_num" >= 5

Note: Speed things up by creating the first rule, duplicate it by right-clicking to copy and paste, and edit the duplicate rules.

Now you can turn each rule on and off to see only the features relevant to a given century.


To make a series of maps, use the Atlas feature in the Print Layout. You can use similar expressions to filter the site features based on the current atlas value. Here's a quick run-through. More detailed documentation of the Atlas feature is available elsewhere or on GIS SE, for instance Automating Map Creation with Print Composer Atlas.

  1. Create a new layer with a single polygon that covers the extent you want on the map. Select the feature, copy and paste it until you have as many duplicate polygons as there are centuries in your time frame.
  2. Add a new field, "Century". Fill "Century" with the corresponding century numbers.
  3. Use this layer as your Atlas coverage layer. Use the "Century" field as the page name.
  4. Add a rule to archaeological site layer, with this filter: "Century_begin_num" <= @atlas_pagename AND "Century_end_num" >= @atlas_pagename. Turn off the other rules.
  5. Generate an Atlas preview. Flip through the Atlas pages, and make sure the correct features are displayed.
  • Thank you a lot for your help! Worked as a charm, but with just one exception! I added a comment and an image of the tabe in the post edit. – Roberto Jul 7 at 21:24
  • I don't see any reason why the Manzano feature would be always showing. I don't think I can fix that for you. If you can't figure it out, a workaround would be to copy that feature into a new layer, and filter that feature out of the original layer. Turn off the new layer and export the atlas. Then turn the new layer on, and manually export the maps for the 11th, 12th and 13th centuries from the atlas preview. – csk Jul 8 at 14:10
  • When exporting the layer as a Shapefile and re-importing it again it works! – Roberto Jul 8 at 14:18
  • Excellent. A self-correcting bug is the best kind of bug. Perhaps there was a space in front of one or both Century values, so QGIS interpreted them as strings instead of numbers. Then perhaps the whitespace was deleted in the export process. – csk Jul 8 at 14:22

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.