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

Including grid ref squares e.g. monads with zero records in dbf files #41

Closed CatharineMoss closed 5 years ago

CatharineMoss commented 5 years ago

I have been using the Biological Records Tool to generate 1km square record density maps to identify under recorded squares for the local biological records centre for which I work (Cofnod). This is very effective. However the resulting dbf file only lists squares for which records exist. It does not list squares with zero records which is what I would like. Would this be a possible enhancement? (I assume for it to do so it would require some sort of boundary (I have been using vice-county boundary vector files)).

burkmarr commented 5 years ago

There is a way to do it now but not from completely within the tool. Create a grid layer covering the area you want using the OSGR tool set to the same resolution as your atlas map. Now use the QGIS 'Join attributes by field value' tool. The input layer is the OSGR grid square layer with the table field set to GridRef; the input layer 2 is your atlas layer with the table field 2 also set to GridRef; choose the attributes you want to bring over with the elements selector and set it off. You will end up with a new layer covering the same squares as your OSGR layer but with attributes pulled over from the atlas layer. Square not represented in the atlas layer will have the attributes you pulled in from the atlas layer (e.g. Records and Richness set to NULL. It's a simple job to update those rows with NULL to zero.

The Biological Records tool is already quite a complicated beast so we have to guard against putting too much in it - particularly where that can be easily achieved by using a short workflow using tools already available.

Have a go with the above workflow and see how you get on.

CatharineMoss commented 5 years ago

Hi Rich

Thank you very much for this. It has worked well and given me what I wanted. (We found the Joins tool under the Layers Properties dialogue).

Thank you again

Catharine.

Sent from Mail for Windows 10

From: Rich Burkmar Sent: 01 May 2019 16:16 To: FieldStudiesCouncil/QGIS-Biological-Recording-Tools Cc: CatharineMoss; Author Subject: Re: [FieldStudiesCouncil/QGIS-Biological-Recording-Tools] Includinggrid ref squares e.g. monads with zero records in dbf files (#41)

There is a way to do it now but not from completely within the tool. Create a grid layer covering the area you want using the OSGR tool set to the same resolution as your atlas map. Now use the QGIS 'Join attributes by field value' tool. The input layer is the OSGR grid square layer with the table field set to GridRef; the input layer 2 is your atlas layer with the table field 2 also set to GridRef; choose the attributes you want to bring over with the elements selector and set it off. You will end up with a new layer covering the same squares as your OSGR layer but with attributes pulled over from the atlas layer. Square not represented in the atlas layer will have the attributes you pulled in from the atlas layer (e.g. Records and Richness set to NULL. It's a simple job to update those rows with NULL to zero. The Biological Records tool is already quite a complicated beast so we have to guard against putting too much in it - particularly where that can be easily achieved by using a short workflow using tools already available. Have a go with the above workflow and see how you get on. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

burkmarr commented 5 years ago

You're welcome. Always more than one way to skin the QGIS cat!