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

composer image error in batch mode #59

Closed pete-ginny closed 2 years ago

pete-ginny commented 2 years ago

I have updated QGIS to 3.22 LTR and fsc tombio plugin to 3.4.1 but still have the same problem as error #58. I can produce batch image maps correctly for each species but when I create composer image maps in batch mode it outputs individual species maps with correct titles etc from metadata but the map itself wrongly displays all dots for all species ie it is running in single map mode. I have taken these maps through atlas .jpg creation and everything works fine ... except that all maps wrongly display all dots, of course. Can we have fix for this please? Cheers, Pete Clarke

burkmarr commented 2 years ago

I will try to take a look at this after work this week.

burkmarr commented 2 years ago

One thought. Have you made permanent layers from your dot maps or have your left them as 'temp' layers? It only works with the TEMP layers which the plugin knows 'belong' to it.

burkmarr commented 2 years ago

I can't reproduce this (including with releases 3.22 of QGIS and 3.4.1 of the plugin). It seems likely that you weren't working with temporary layers as they are generated from the CSV.

pete-ginny commented 2 years ago

Hi Rich, Yes I had made the layers permanent. I have just rerun with batch mode and atlas circles and points to create the temp layers, with layout open in the background with the overlay in place on the original blank map, and atlas settings set. Once the temp layers were created and all ticked (of course the maps shows all dots), I switched to the layout screen. Opted to create atlas as images but they have still come out with all dots for all species on every map.

I am lost with this. Should I have selected atlas 1km squares instead of points or something? Cheers, Pete Clarke


From: Rich Burkmar @.> Sent: 04 April 2022 20:36 To: FieldStudiesCouncil/QGIS-Biological-Recording-Tools @.> Cc: pete-ginny @.>; Author @.> Subject: Re: [FieldStudiesCouncil/QGIS-Biological-Recording-Tools] composer image error in batch mode (Issue #59)

I can't reproduce this (including with releases 3.22 of QGIS and 3.4.1 of the plugin). It seems likely that you weren't working with temporary layers as they are generated from the CSV.

— Reply to this email directly, view it on GitHubhttps://github.com/FieldStudiesCouncil/QGIS-Biological-Recording-Tools/issues/59#issuecomment-1087938017, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AXXALKHLRQ5LHNSPYGXPZTDVDNAEXANCNFSM5R66YJKA. You are receiving this because you authored the thread.Message ID: @.***>

burkmarr commented 2 years ago

Hi Pete. It sounds to me like it should have worked, though you don't have to have any of the temporary layers displayed when you are doing this - the batch processing takes care of turning them on and off one at a time (though you don't see it). It might just be worth trying it with the visibility of all your temporary layers off (though I think the way you did it should also have worked). If that doesn't work, can you post here a couple of screenshots? One of your layer control at the point where you are ready to create the images and one of the biological records tool options tab at the same point. (You can use something like the Windows snipping tool to create the images. Then you just copy the image and paste it into a post here.)

pete-ginny commented 2 years ago

Hi Rich, I've sent too many screen shots but it shows everything I am doing. When I deselect the layers we get dot-less maps, if selected we get ALL dots on every map. Also, the map title #ABH no# #Taxon# is not being translated on to each map. Hope this makes sense. Cheers, Pete


From: Rich Burkmar @.> Sent: 06 April 2022 08:33 To: FieldStudiesCouncil/QGIS-Biological-Recording-Tools @.> Cc: pete-ginny @.>; Author @.> Subject: Re: [FieldStudiesCouncil/QGIS-Biological-Recording-Tools] composer image error in batch mode (Issue #59)

Hi Pete. It sounds to me like it should have worked, though you don't have to have any of the temporary layers displayed when you are doing this - the batch processing takes care of turning them on and off one at a time (though you don't see it). It might just be worth trying it with the visibility of all your temporary layers off (though I think the way you did it should also have worked). If that doesn't work, can you post here a couple of screenshots? One of your layer control at the point where you are ready to create the images and one of the biological records tool options tab at the same point. (You can use something like the Windows snipping tool to create the images. Then you just copy the image and paste it into a post here.)

— Reply to this email directly, view it on GitHubhttps://github.com/FieldStudiesCouncil/QGIS-Biological-Recording-Tools/issues/59#issuecomment-1089924421, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AXXALKGO2HI5LHROTQRSWYTVDU44BANCNFSM5R66YJKA. You are receiving this because you authored the thread.Message ID: @.***>

burkmarr commented 2 years ago

Hi Pete. Where have you sent the screenshots?

pete-ginny commented 2 years ago

Hi Rich, I attached them to my reply to your email as there was no link or address at 'post here' in your email. There were 12 very small pics at each step of the process. Shall I send the email again or where do want the screen shots sent too? Cheers, Pete


From: Rich Burkmar @.> Sent: 08 April 2022 09:34 To: FieldStudiesCouncil/QGIS-Biological-Recording-Tools @.> Cc: pete-ginny @.>; Author @.> Subject: Re: [FieldStudiesCouncil/QGIS-Biological-Recording-Tools] composer image error in batch mode (Issue #59)

Hi Pete. Where have you sent the screenshots?

— Reply to this email directly, view it on GitHubhttps://github.com/FieldStudiesCouncil/QGIS-Biological-Recording-Tools/issues/59#issuecomment-1092600810, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AXXALKBHUTBQNFNBKSANJB3VD7VRHANCNFSM5R66YJKA. You are receiving this because you authored the thread.Message ID: @.***>

burkmarr commented 2 years ago

Hello Pete. Instead of replying to this email, you can go directly to the GitHub issue here https://github.com/FieldStudiesCouncil/QGIS-Biological-Recording-Tools/issues/59 and enter a new comment. You can paste the images into the comment. Failing that, you can email them to me at rich.burkmar@gmail.com

burkmarr commented 2 years ago

Hello Pete. I got the pictures and now I see the problem! You have confused the 'atlas' feature of QGIS layouts with the atlas mapping available through the TomBio Plugin Biological Recording tool. You do not need to use the QGIS layout atlas feature at all - that does something quite different to a 'biological recording altas map'.

You need to look at the documentation on this page - https://www.fscbiodiversity.uk/qgisplugin/biorecstool. (You can also reach it via the last button on the TomBio toolbar). Go down to the section marked 'Output options'. The most important bit is:

Once an option is selected in the format drop-down list, use the save button to save the layers or images into the folder that you have specified using the browse output folder button. image

This is the bit you are missing - instead of doing this you were going to the QGIS atlas feature to try generate the maps.

burkmarr commented 2 years ago

Hi Pete,

Thanks for sending the CSV files, the style file and the layout template. Seeing the template was key to me working out what was going on here. Two things have been hindering you:

  1. Confusion between the atlas mapping of the TomBio Biological Record plugin and the QGIS core atlas feature.
  2. A problem with your layout.

The Atlas tab and the Atlas menu on the layout composer tool (pictured in your screenshots '3 make layout' and '6 create atlas images' - both shown below) have nothing to do with the TomBio Biological Record plugin and you don't use them to create biological record atlas maps.

3 make layout

6 create atlas images

When I first carried out the correct process using the files you sent me I got the image files with the ABH number and Taxon correctly filled in and the files named after the taxon. But there were no dots. When I looked more carefully at your layout I noticed that there were two map frames. The 'proper' one filling most of the layout page and a much smaller one. I deleted the smaller one and it all worked (giving the output shown below).

In your screenshots '3 make layout' image (shown above) you can see that it actually shows three map frames on the map in the item properties frame, though only one of them has it's visibility checkbox ticked. If you delete the two that aren't used, I think it will work for you. I think that the plugin is displaying the map dots in the first map frame it finds on the layout, which in this case was one of those not displayed.

Acentria ephemerella

Achroia grisella

Acleris aspersana

Acleris bergmanniana

Acleris caledoniana

Rich

pete-ginny commented 2 years ago

Thanks for your help - see #58. All due to 2 map items in layout. Now works perfectly. Pete

pete-ginny commented 1 year ago

Hi Rich, Thanks for getting to the answer. Sorry to have wasted so much of you time!

How annoying! - I had noticed that the extra maps were there but didn't think they were involved 'cos they were unticked. Sorry.

So now I have 660 maps of 20Mb pngs labelled by their taxon name.

As the layout atlas process is able to complete the job of outputting files as small jpgs with the map||abh titles, is there any way that the now perfect composer image maps could have this process done to them? It will take me many hours to shrink and rename each file, so any way of automating the process would be wonderful. Thanks again, Cheers, Pete


From: Rich Burkmar @.> Sent: 11 April 2022 20:57 To: FieldStudiesCouncil/QGIS-Biological-Recording-Tools @.> Cc: pete-ginny @.>; Author @.> Subject: Re: [FieldStudiesCouncil/QGIS-Biological-Recording-Tools] composer image error in batch mode (Issue #59)

Hi Pete,

Thanks for sending the CSV files, the style file and the layout template. Seeing the template was key to me working out what was going on here. Two things have been hindering you:

  1. Confusion between the atlas mapping of the TomBio Biological Record plugin and the QGIS core atlas feature.
  2. A problem with your layout.

The Atlas tab and the Atlas menu on the layout composer tool (pictured in your screenshots '3 make layout' and '6 create atlas images' - both shown below) have nothing to do with the TomBio Biological Record plugin and you don't use them to create biological record atlas maps.

[3 make layout]https://user-images.githubusercontent.com/9275178/162818671-86167a77-00ce-4677-af0a-9495f6ef79fa.JPG

[6 create atlas images]https://user-images.githubusercontent.com/9275178/162818691-196a6b10-6195-4b05-8fd6-3dd386d8e8ed.JPG

When I first carried out the correct process using the files you sent me I got the image files with the ABH number and Taxon correctly filled in and the files named after the taxon. But there were no dots. When I looked more carefully at your layout I noticed that there were two map frames. The 'proper' one filling most of the layout page and a much smaller one. I deleted the smaller one and it all worked (giving the output shown below).

In your screenshots '3 make layout' image (shown above) you can see that it actually shows three map frames on the map in the item properties frame, though only one of them has it's visibility checkbox ticked. If you delete the two that aren't used, I think it will work for you. I think that the plugin is displaying the map dots in the first map frame it finds on the layout, which in this case was one of those not displayed.

[Acentria ephemerella]https://user-images.githubusercontent.com/9275178/162818769-07827fe8-6f77-4fa0-80df-be70bc35893d.png

[Achroia grisella]https://user-images.githubusercontent.com/9275178/162818773-98179a1a-8503-4a7b-91a8-45ef6171e878.png

[Acleris aspersana]https://user-images.githubusercontent.com/9275178/162818790-02eff7fa-d3de-480a-afc0-779a073644e5.png

[Acleris bergmanniana]https://user-images.githubusercontent.com/9275178/162818802-c2ec786e-bd01-4e7a-8738-efa2e5890316.png

[Acleris caledoniana]https://user-images.githubusercontent.com/9275178/162818816-bb82d8ee-37fa-4020-bcf7-da034d18ebb3.png

Rich

— Reply to this email directly, view it on GitHubhttps://github.com/FieldStudiesCouncil/QGIS-Biological-Recording-Tools/issues/59#issuecomment-1095505453, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AXXALKGB7VYCKLDT7DNG5P3VER72JANCNFSM5R66YJKA. You are receiving this because you authored the thread.Message ID: @.***>

burkmarr commented 1 year ago

Hi Pete,

There's currently no way to specify the naming format so you will have to find a way to rename the files. If you know someone that is a wiz with any sort of scripting language and has the time to help you, they may be able to help you out.

There's better news on the image size though. Yu can change the composer layout export resolution (from the default which is probably 300 dpi) to something smaller before you batch generate the images. The setting you're after is show at the bottom of this screen grab.

image

pete-ginny commented 1 year ago

Hi Rich, Thanks for the output map size fix. It is quite a while since I logged the request so thanks again for dealing with it. Should any other updates affect the map naming issue or possible change to Atlas processing, please let me know. Best regards, Pete Clarke


From: Rich Burkmar @.> Sent: 11 October 2022 14:08 To: FieldStudiesCouncil/QGIS-Biological-Recording-Tools @.> Cc: pete-ginny @.>; State change @.> Subject: Re: [FieldStudiesCouncil/QGIS-Biological-Recording-Tools] composer image error in batch mode (Issue #59)

Hi Pete,

There's currently no way to specify the naming format so you will have to find a way to rename the files. If you know someone that is a wiz with any sort of scripting language and has the time to help you, they may be able to help you out.

There's better news on the image size though. Yu can change the composer layout export resolution (from the default which is probably 300 dpi) to something smaller before you batch generate the images. The setting you're after is show at the bottom of this screen grab.

[image]https://user-images.githubusercontent.com/9275178/195098946-2d444277-b8c2-44b8-9883-7bc1bab0af47.png

— Reply to this email directly, view it on GitHubhttps://github.com/FieldStudiesCouncil/QGIS-Biological-Recording-Tools/issues/59#issuecomment-1274662159, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AXXALKAWZGAAX7OYDEFH7F3WCVRFZANCNFSM5R66YJKA. You are receiving this because you modified the open/close state.Message ID: @.***>