qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.38k stars 2.98k forks source link

Processing: duplicate entry when using batch mode #49514

Open mfstanton opened 2 years ago

mfstanton commented 2 years ago

What is the bug or the crash?

When using the TOOLBOX GDAL Raster Projection Warp Batch Creation script the first thing I notice is that the first row of the task setup is populated (row 2) with the last Layer selected in the Layers Panel of the Desktop UI. When the "Fill Down" is activated with Select Open Layers it is populated with the open layers plus a second copy of whatever layer was in the First row of the setup window. Attempting to remove the original Row 2 from the task list does not work. If not observed before completing the setup steps, this leaves two tasks to reproject the Layer where the second one fails giving an error message in the job log. While only one job failing is a minor rerun action on the part of the user. That first failure of the Reproject job leaves an error setting somewhere that prevents the remainder of the jobs in the list, which could be lengthy for some projects, to fail to reproject, writing the original TIFF to the output folder and continuing on for the remainder of the files. I have a log file that contains the rejection of the second attempt to reproject the tile but it is rather sizeable Double_Selection_First_EntryScreenshot 2022-07-29 111909 Selected_Last_Layer_Screenshot 2022-07-29 105421 Selected_Layer_Screenshot 2022-07-29 105421 Select_All_Screenshot 2022-07-28 200030

Short_Reproject_Log_Document.txt

Steps to reproduce the issue

Open Layer with input images Open Toolbox and go to GDAL Raster Projection, Warp (reproject) Right click on menu item Select Batch processing option When spreadsheet pops up look at the contents of Row 2 where you will see an entry that corresponds to the last selected Layer. This entry cannot be removed. If you right click on the Inputs field Autofill option you will get a menu which gives you an option to select the Open Layers. Click the entry and when the popup shows click "select all" then OK. You will see two entries for the layer that was in the initial window. Running your job will error because there will be an attempt to put a second copy of the file into the folder.

Versions

Buenos Aires 3.26.1

Was doing the same on the prior versions 3.26.0

Supported QGIS version

New profile

Additional context

I am trying to reproject from a UTM CRS to a Missouri State Plane West projection.

The workaround is to unselect the item that shows up in the Row 2 of the Layer list when selectinf layers from the popup . Note that the remainder of the output files after the one with the error will ALSO not be reprojected and stay in the same CRS as that of the input layers. There seems to be a persisted error flag that keeps the reproject from happening if this error occurs

gioman commented 2 years ago

Open Layer with input images Open Toolbox and go to GDAL Raster Projection, Warp (reproject) Right click on menu item Select Batch processing option When spreadsheet pops up look at the contents of Row 2 where you will see an entry that corresponds to the last selected Layer. This entry cannot be removed. If you right click on the Inputs field Autofill option you will get a menu which gives you an option to select the Open Layers. Click the entry and when the popup shows click "select all" then OK. You will see two entries for the layer that was in the initial window. Running your job will error because there will be an attempt to put a second copy of the file into the folder.

@mfstanton really hard to read description, but let me see if I understand, the problem stands from the fact that you get a duplicate entry in batch mode once you choose to "Select from Open Layers" and you cannot remove the duplicate entry, that is correct? if yes then I cannot replicate on 3.26.1 on Windows 10.

mfstanton commented 2 years ago

Yes that is correct. I get around it by opening batch mode and unselecting the one that was picked as the last referenced. The problem is that the whole process is sloppy and generates an error because there was one image highlighted at first and IT gets picked to be in the list twice. Not sure what makes it so hard to read. Once the selection was made the screenshot shows two entries for the same image and the extra cannot be deleted. So far I have been able to do 20,000 images by unchecking the first image in the list (select from open layers popup) as it is the one being duplicated and the menu gets built correctly.

From: Giovanni Manghi @.> Sent: Monday, August 8, 2022 11:07 AM To: qgis/QGIS @.> Cc: mfstanton @.>; Mention @.> Subject: Re: [qgis/QGIS] Toolbox GDAL Raster Projection Warp Batch Creation (Issue #49514)

Open Layer with input images Open Toolbox and go to GDAL Raster Projection, Warp (reproject) Right click on menu item Select Batch processing option When spreadsheet pops up look at the contents of Row 2 where you will see an entry that corresponds to the last selected Layer. This entry cannot be removed. If you right click on the Inputs field Autofill option you will get a menu which gives you an option to select the Open Layers. Click the entry and when the popup shows click "select all" then OK. You will see two entries for the layer that was in the initial window. Running your job will error because there will be an attempt to put a second copy of the file into the folder.

@mfstanton https://github.com/mfstanton really hard to read description, but let me see if I understand, the problem stands from the fact that you get a duplicate entry in batch mode once you choose to "Select from Open Layers" and you cannot remove the duplicate entry, that is correct? if yes then I cannot replicate on 3.26.1 on Windows 10.

— Reply to this email directly, view it on GitHub https://github.com/qgis/QGIS/issues/49514#issuecomment-1208319278 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AFP6E7KWDAJPDABD3VDXKB3VYEWBXANCNFSM55BPIXXQ . You are receiving this because you were mentioned. https://github.com/notifications/beacon/AFP6E7PYZHUDKOMVNHYHNYDVYEWBXA5CNFSM55BPIXX2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOJACX2LQ.gif Message ID: @. @.> >

gioman commented 2 years ago

I edited the title for sake of clarity.

spatialthoughts commented 1 year ago

I can reproduce this on the current QGIS 3.22.16 LTR as well. This is a regression from earlier versions and is not a good user experience. When using Autofill from 'Select from Open Layers' , there is already 1 row with one of the layers and if that layer is also selected, it creates a duplicate entry. It should skip the layer that is already present in the first row.