2

I'm interested to create a vector point layer representing the centroid of some 500-1000 PDF files exported from QGIS to find PDFs geographically rather than file explorer.

The algorithm 'Tile Index' seems most appropriate as the directory file path is retained. Tile Index will leave me with a polygon extent of the PDF from which I will extract the centroid. The issue is that by selecting >1 PDF as the input, no output is created. Below is the result of the algorithm run twice for each PDF shown. They are labelled with a file path for demonstrative purposes.

Is there a bug or PyQGIS workaround to allow more than one PDF input?

enter image description here

1

Tile Index, like most QGIS processing tools, has a batch processing mode. To access batch processing mode, right click on the tool name > Execute as Batch Process.

enter image description here

Once you have the tool open in batch processing mode, select as many input layers as you want. Be sure to check the "load layers on completion" box if you want the layers loaded into the project. Otherwise you'll have to remember where you saved them for the next step.

enter image description here

This will create many separate layers, with one raster extent polygon per layer. You can either:

  • Use the merge vector layers tool to combine them into one file before running the centroids tool, or
  • Run the centroids tool in batch processing mode. This will put each centroid in a separate file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.