0

In the past with QGIS I was able to autofill layer names into file names when doing a batch export. Trying this now though, the autofill doesn't bring in the layer name. I'm using the Windows version of 3.38.1, when I set up my file name I add a prefix and underscore, I tell the autofill to use the Layer Name as the parameter, however, the paths just show the prefix in the file name and running the process causes the exports to overwrite each other so only the last run export is all that is in the results folder.

When I try to autofill by expression the @Input variable works, but adds a random string to the end of each layer's name. Using the @LayerName acts like the layer name parameter, nothing gets appended to the end of my provided string.

It has been a while since I've tried this, was there a change to the setup process? I've check the documentation and some recent tutorial versions and I'm not seeing any changes to the old procedure.

asked Aug 19, 2024 at 17:29

1 Answer 1

2

Two suggestions for managing this:

1st method: Use the Calculate by Expression to build the output filename. The screenshots show the result with a batch clip operation. Same logic can be used with other batch operations. enter image description here The layers below will be filled automatically: enter image description here

2nd method: First set an output file for the 1st layer. The screenshots show the result with a batch clip operation:

Set the output file for the 1st Layer: set output file

Next, select the options shown here:

screenshot of parameters

Result:

result

answered Aug 20, 2024 at 9:51
2
  • The 2nd method is what I was trying, and I'm not sure what I was missing but I got it now, thank you! For the 1st method, I did get that to work yesterday but @INPUT was appending an underscore and a long string of random characters. In your example, is the file_name function stripping those characters off? Commented Aug 20, 2024 at 14:07
  • Yes - in the 1st method, the random characters are not generated as part of the layername. I think the random characters relate to temporary files. Commented Aug 20, 2024 at 14:30

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.