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.