2

I am writing a script for QGIS that will identify the perimeter of only external facing walls.

The script is probably a little long to post directly into this post, but it is accessible here.

The script works when I am in QGIS's script editor and hit run i.e. the dialog box comes up and all runs as expected.

enter image description here

However upon using the 'add script from file' button (Processing > Toolbox > Add script from file) I am greeted with the error:

The selected file does not contain a valid script

Unfortunately I can't seem to get any break down or tracestack of why this is the case. I've tried examining the GitHub page for the function responsible but am unable to uncover any answers.

1 Answer 1

7
## Iterate through each of the buildings

That should be a single comment sign (#), not a double one, otherwise, it tries to parse it as if it was a parameter, and it fails

Yyou do not need to add the script from file. Just save it to the scripts folder, and it will be automatically added to the toolbox

1
  • This was the correct answer. The issue was having a double hash (##) as one of my normal comments. The double hashes are reserved for input variable assignment by QGIS Processing Jan 27, 2016 at 9:19

Your Answer

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

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