Killing my shapefiles in QGIS

المشرف العام

Administrator
طاقم الإدارة
I ended up teaching the QGIS class this week. It was a re-write and it was a lot of material. Probably 25% of the material was new and I’m borderline on this class going 2 days. I really want to keep it at 1 day.

I’ve also been moaning about shapefiles a lot lately. My goal this year is to eliminate shapefiles from my workflow. Which doesn’t mean they may not be part of a delivery – I just don’t want a shapefile as a step in the process. Which right now leaves me at one of two data paths/formats for work: Spatialite and PostGIS.

If you’ve used QGIS any you’ve no doubt clicked on the vector menu (ignore the highlighted raster portion – I’ve got a cat sleeping in my lap).



You’ve no doubt noticed the output is always a shapefile. *It’s a bit frustrating – especially as I’m on my “no shapefiles” kick. This menu is part of the Ftools plugin. Ftools has been around for quite a while. Maybe for as long as QGIS has been in existence. As I was editing the class and working last week I started noticing two things: the first is that I’ve been in a routine of clicking on parts of QGIS I’m comfortable with and second I’m ignoring the newest portions.

What are the newest portion(s)? – the scratch layers or memory layers and the processing toolbox development.

Following my old workflow I would buffer a point using the vector menu. The buffer would be written out to shapefile. I would then import at some point all the shapefiles into PostGIS or spatialite. Why not buffer in PostGIS? I have been from time to time but this is more about the desktop.



What If I used the processing toolbox? I take a point and buffer it using the processing toolbox. I then export my data to a memory/scratch layer and if it’s good I save it permanently. Thanks to the processing toolbox I have even more options. I can dump directly to a database……or a file…or a memory/scratch layer…..



Yes – more than a shapefile. The bard part was – this has been sitting right in front of me for a bit. As the software develops I get stuck in a routine and am missing the really good stuff that is appearing. It’s also giving me the option of different file formats if I want to save a physical file.

Back in my ESRI Instructor Days I always advocated for 2 file based geodatabases for working. I wanted one for production data and one for scratch. At the end of the project I deleted scratch. Now I might be advocating two spatialite databases OR a PostGIS Schema of “TEMP” for working.

I emailed Nathan Woodrow and did a bit of digging and FTools is on it’s way out. Probably in the next QGIS release it will be replaced by the processing tools. What about your favorite FTools command? They are in the processing toolbox.

I ended up tossing this into my class a bit last minute and ran through an example. It’s a bit painful for new staudents because I’m preaching kill your shapefile – but that’s how they need to think. This isn’t 1999.

Can I now eliminate shapefiles from my life? Yes. Probably the only bad thing I’m going to have to do is provide file based geodatabases for clients from time to time (but if I do they will get a spatialite one also just to make them curious). I will still deliver shapefiles to clients if they are needed.

Check out the processing toolbox and do a bit of exploring. I haven’t touched the vector menu in over a week now.



أكثر...
 
أعلى