FieldStudiesCouncil / QGIS-Biological-Recording-Tools

QGIS plugin for biological recorders. Created with the FSC Tomorrow's Biodiversity project.
GNU General Public License v3.0
10 stars 4 forks source link

Distribution maps - subspecies maps merged into one #4

Closed bill456 closed 7 years ago

bill456 commented 7 years ago

Hi

Firstly, can I say a huge thank you for making this plugin available. I need to create nearly 2000 dot maps and your plugin makes that a breeze.

Some background: I'm using QGIS 2.18.1 and the v2.6.2 of the TomBio tools. I'm mapping distribution of plants in the Scottish borders. The distribution data is held in a PostgreSQL v9.6 database and PostGIS v2.3.0. I'm creating the maps using the TomBio plugin by taxon and then saving them as an image.

However, I am having an issue with the creation of the some of the dot maps. The issue is evident on QGIS and not just in the saved image. What is happening is that two lots of plant data are being mapped in one map. It seems to occur when the plant taxon names share the same species name. eg Agrostis canina and Agrostis caninia sens. lat. ie: when sens. lat. is appended to the plant name, or there is a separate subsp., agg. or var. varient of the plant.

This is happening consistently where the plant names are similar in this same way:

When there are more than two subspecies it seems to happen randomly. In the case of the Arenaria serpyllifolia maps the Arenaria serpyllifolia map is merged with the Arenaria serpyllifolia subsp. leptoclados map not with the other two. Similarly with the Aira caryophyllea maps.

You can tell when there is a merged map as the plant name labels are overlaid (luckily I told QGIS to draw the label even if they collide with other labels otherwise I may not have spotted this) and when inspecting the underlying data it is evident that both species data is mapped on a single map.

It appears that the mechanism to get the unique species name doesn't take into account the full name when getting the data for the individual maps.

Could you take a look at this and hopefully fix it? Let me know if you want any more information.

Thanks very much.

-Bill-

burkmarr commented 7 years ago

Hello Bill. Thanks for your comments and the detailed analysis and description of your problem. As it happens I found some separate (by maybe related) bugs to do with taxa names recently and I've sorted those out, but not published the changes yet. I will look into your problem in the next day or two and report news to you here.

burkmarr commented 7 years ago

Hi Bill. I think that I was able to reproduce your problem - or something very similar - and I have a fix. Before publishing a new release, it would be good to know if it fixes your problem. Would you mind trying it out for me? The fixed code is all in one file which is in the attached zip file. To try it out you will need to replace a single file - bioreclayer2.py - in your plugin folder which will be something like this if you are using Windows: C:\Users\fsc.qgis2\python\plugins\QGIS-Biological-Recording-Tools (fsc is my username on my computer so yours will be different).

The new version of this file is here: https://raw.githubusercontent.com/burkmarr/QGIS-Biological-Recording-Tools/issue-4-fix/bioreclayer2.py

You need to save that to the plugin folder, replacing the one that's there. In Google Chrome, just enter the above address in your addressbar then right-click your mouse on the page and choose 'Save as'. If Chrome tries to put add a '.txt' extension to the filename, remove it. Once you've done that you will need to restart QGIS if it's already running. Then you should be able to try it out.

Let me know whether or not you can try this out and, if so, how you get on.

Rich

bill456 commented 7 years ago

Hi Rich Good news, thanks. I'll test the fix this evening and get back to you, if that's ok? Drawing plant distribution maps isn't my day job unfortunately - I'm doing it for my Dad who is publishing the flora of Roxburgh and Selkirkshire. Cheers -Bill-

burkmarr commented 7 years ago

Thanks Bill that would be great. I forgot to say how pleased I was to see what you are doing with the tool - that's a great thing for us to know of and I would like to mention it when I report back on the project. Please keep me informed about the progress of the Flora of Roxburgh and Selkirkshire.

bill456 commented 7 years ago

Hi Rich

Yup, that update did the trick. I've just ran off all the dot maps (1800+) and none of them were merged. So thanks very much for fixing the issue so promptly.

I've sent you an email re Dad's flora - no point in continuing that conversation here - and I've deleted the dot maps from in my first message, Hope you're ok with that.

Cheers

burkmarr commented 7 years ago

That's great - I'm glad it worked. The update will be included in the next maintenance release which I will probably create at the weekend.