Creating date bands on Maps

Good morning!,

Am new to QGIS but finding the video tutorials extremely useful. I am looking to create an Atlas of Spiders & Harvestmen of Watsonian Yorkshire - with three date bands (Before 1980; 1981 - 2000; and 2000 - 2020). There was no obvious approach in QGIS (is this correct?) so I created a Rule using the Layer Properties>>Symbology>>Categorized>>Value [First Year].

For avoidance of doubt, I have a column with just the year (date and month irrelevant) in the .csv file which I have linked to the First Year drop down on the relevant menu. However, if I use the Last Year drop down, I get a different map - so something that I am doing would appear to be incorrect - probably the whole approach.

Help and pointers would be much appreciated.

Many thanks

Richard

Hi Richard. Are you looking to create separate maps for each year range for each species?

Rich

Hi Richard,

Erm…Not sure the answer is Yes.

Basically am looking to create a hectad/ tetrad map for each species with the same bands for each output. As you can do on MapMate.

Then export each map as a picture file with key.

Thanks.

R.

Hi Richard. The bug that I mentioned (which hadn’t yet got in your way but probably could have done if you proceded) is now fixed in version 3.4.1 which you should update to.

Now to your original question…

If you want to have three colours on each map (one for each date class) you need to decide what happens in squares (tetrads or monads?) where you have records in more than one band, i.e. do you want to colour the square in response to the most recent or the oldest record?

Pick a single taxon - one that you know will have squares in every date band - and generate an atlas map for it. For that single layer, create rule-based styles that show the three year bands in the colours you want. The style rules will be based on the numeric value of either the FirstYear or LastYear column of the atlas layer - depending your decision above. The styles for that layer can then be saved to an indepedent style file which you then reference from the options tab of the Biological Records tool and check the ‘add style’ box.

Now when you do a batch generation for all your taxa, the styles you created will be automatically applied to every atlas layer for you.

If you get that far, I can explain a little trick you have to perform to get the legend for those styles into a composer (printing) layout that can be used in the batch generation of images.

Rich

Thanks Richard, Much appreciated. I didn’t get any earlier comms regarding a bug or need to update to version 3.4.1. Am a newbie to QGIS and finding my way - so how do I update to v.3.4.1; and what needs updating - I assume QGIS itself? Thanks

Hi Richard. Sorry I mentioned the bug in another relelated thread to someone else - I thought I had mentioned it to you. The bug was in the plugin code - not QGIS, so you just need to update the plugin from version 3.4.0 to 3.4.1. You do that through the plugin manager. Look at your installed plugin there - you should see a button on the bottom right to update it.

Rich

Hi Richard B.,

Your assistance has been immensely helpful.

My further queries as posted on Twitter (in haste):

  1. Create consistent template & key which auto-completes with sp. name;

  2. Remove white space which appears when converting to .jpeg file;

  3. Create batch maps for all spp.; &

  4. is it possible to automatically insert maps into Word?

Hi Richard,

From the point of view of the QGIS Plugin, you should be able to find the answer to many of the tasks associated with questions 1 and 3 in the guidance on using the Biological Records tool here: The Biological Records Tool for QGIS | Biodiversity Projects. In particular, you should look at the sections titled ‘aggregating records (atlas maps)’, ‘working in batch mode’ and ‘output options’. The last of those sections includes using a metadata CSV file to replace text tokens in a map composer (now called print layout) with values from the CSV. Using that you can automatically put scientific or common names in your print layouts when you create them in batch mode.

To get the best results, you need to get very comfortable with creating print layouts in QGIS. There are no shortcuts to this really, but I would suggest finding and working through a few tutorials, or YouTube demos - the more recent the better. The print layout is a very sophisticated tool with a lot of options. When you have created a print layout that you are happy with, you use the ‘Composer image’ option from the format drop-down list on the output options tab of the biological records tool.

One useful trick I can tell you about concerns making a consistent legend on your print composer. This is only useful if you want to use exactly the same legend on all output images. Happily, for consistency, this is nearly always the way bioogical records atlases want to display their maps. Once you have settled on a QGIS style (layer symbology) that you want to use to display all your atlas maps, you need to save that style to an independent style file. Then you can use the ‘apply style file’ option in the biological records tool to apply that to each layer when they are created in batch mode.

But because the map layer changes for each map generated through the composer, you cannot use the map layer itself to generate a legend in the layout. Instead, create a ‘dummy’ shapefile, e.g. by copying one of your atlas map layers that has the desired style. Open this layer in QGIS but turn the display off (in the layers control). When you are setting up your print layout, build a legend based on this dummy layer - turning off the automatic update and removing all unwanted layers from the legend. This legend will be displayed unchanged as the atlas layer changes in the composer.

For question 2, there is isn’t a way to do this from the tool itself, but you can do it after the images are created using some other tool such as Windows Powershell or Command line batch file. A quick google found these examples, but there will be many more: windows - How to remove spaces from file names (in bulk) - Stack Overflow

Re question 4, there’s no automatic insertion into Word straight from this tool, so you’d have to find some other way of doing that. Maybe you could do it with a document written in HTML or Markdown and then convert that to Word.

Rich