QGIS Process Command

Jul 15, 2021 | FOSS4G, QGIS

I’m wrapping up the 2nd QGIS Class and have been digging hard into the python/scripting/programming side of QGIS. A programmer I am not and usually I have to pick some sort of path into the software that makes sense to me. Scripting has been coming up more and more as I dive back into the TN 911 Project.

I discovered something that’s been around for the last bit in qgis and I no doubt read the release notes on it……….and immediately forgot about it: qgis_process. You have a command line way to access QGIS Processing tools. My examples will be Linux oriented but it works on <fill in the blank>. Open a shell window and type qgis_process:

If I want a list of tools at my disposal: qgis_process list

If I want to know about a tool in particular: qgis_process help qgis:buffer

What if you want to run a command:

qgis_process run qgis:buffer –INPUT=parks_2274.shp DISTANCE=5000 –OUTPUT=parks_buffer.shp

….and if I check the output using QGIS:

Of course I did it all using shapefiles – I’ve got all the output file types I need at my disposal.

The nice thing is I have this uncomplicated way to access the processing tools and running them. Granted this isn’t Python but still – a command line way to access what you want to access. You could set up a very uncomplicated process to: Buffer -> Clip -> Merge -> Whatever you want without cracking open the desktop.

This points out two problems in my life:

  • Generally just keeping up. QGIS is an exciting side of life for me and one I enjoy. I really enjoy this because I started my life on the desktop with analysis and data cleanup. I’ll most likely end my career still enjoying that side of life – oh yeah Desktop GIS is dead I forgot.
  • Running a business is everything BUT the technical bells and whistles I enjoy. I need to make more time for that even if I have to block off a Friday morning for 2 hours and just buffer parks for no reason.

You may also like

Model Designer Class June 25th 2024

Model Designer Class June 25th 2024

June 25th Location: Virtual Cost: $150 Time: 12pm to 4pm EST Link: https://www.eventbrite.com/e/qgis-model-designer-tickets-906763111877 The Model Designer Class makes a re-appearance after a tuneup. What is it? This 4 hour class will cover building Processing Models...

Conda and QGIS Part 2

Conda and QGIS Part 2

Coming back from Yellowstone has left me slightly adrift. I missed a meeting yesterday as I keep forgetting to add things to my calendar. So the last time I mentioned Conda was like 2018 and the whole point to the Article was "I can now have two versions of QGIS...

Calculating NDVI in QGIS

Calculating NDVI in QGIS

Titling these articles is getting more difficult. I almost called this my "Getting my Junior Forestry Badge" because that's what I told one client the other day as I confidently misidentified another tree on a walk. A forestry person I am not - but I've gotten pretty...