ImportPhotos icon indicating copy to clipboard operation
ImportPhotos copied to clipboard

Add bulk image export button

Open spwoodcock opened this issue 9 months ago • 1 comments

Requirement

  • First off, thanks for this plugin - it's fantastic!
  • At HOT we use this to import drone imagery into QGIS, from multiple source directories.
  • An additional requirement is to bulk export all of the imported images (copy them) into another directory.
  • This collection of images is then uploaded to another tool for processing into an orthomosaic.

Solution & Screenshots

  1. I added a bulk export button to the toolbar, with an icon and dialogs.

    1-bulk_export

  2. Clicking the button opens a similar dialog for layer selection to the 'Update Photos' button (I reused the code, which only allows for the selection of layers generated by this tool).

    2-export-layer

  3. A directory selector dialog is shown.

    3-select-folder

  4. The 'Path' attribute for the layer is used to copy the files to a new directory. On success a dialog is shown.

    4-export-complete

The test directory containing 3 image sub-directories (flight1, flight2, flight3):

5-root-dir

The content of the final output directory, with the subdirectory name prepended to the files:

6-output-files

Notes

  • The diff is huge, but the contribution is actually quite small. I ran pyrcc5 -o resources.py resources.qrc to update the resources.py file.
  • I also fixed a bug where closing the layer selection dialog for 'Update Photos' causes an exception (as no layer is selected for subsequent code).
  • We would love to make another contribution to allow for spatial filtering via a layer selection (currently spatial filtering is only possible from canvas extent). Is this a desirable contribution?
  • Also worthy of note, should I be including some translations in this PR too?

spwoodcock avatar May 22 '24 11:05 spwoodcock