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

Tricks with an ESRI File Geodatabase

Tricks with an ESRI File Geodatabase

A few years back I jumped in way over my head with QGIS/Postgis. I had moved a process out of one software and into my favorite two (QGIS/PostGIS) and little did I know the final output had to be a ESRI File Geodatabase. So what did I do? I shamed them into using a...

Making the Invalid Valid

Making the Invalid Valid

I could argue I'm doing that on multiple levels these days. Except I want to talk Geometry, QGIS, and Forks in the Road. I haven't done just a "QGIS Tech Post" in a while. I talk about it and training and generalities but hardly dive into the specifics. So here is a...

Training, Websites, and Life

Training, Websites, and Life

So back last year I started something and have just finished one small part of it: https://training.northrivergeographic.com The Intro to QGIS class has a new home and that new home has a lot of room for a lot of different things. Something like 12 years ago (or more...