QGIS 2.6: Virtual Fields

Oct 30, 2014 | GIS, Open Source GIS, QGIS

Virtual Fields – huh?

So something else new in QGIS 2.6. In case you aren’t familiar with QGIS – you have a field calculator. It’s as the name implies – a place to calculate attribution and a chance to get technical with expressions if needed.You can calculate areas, do string manipulation, and release your inner math demon.

If I can walk you through an example of why this is cool and your brain can run with ideas. I have a polygon that I’m working on with my clients. They wish to know how big of an area the polygon covers. So I’m going to create a new field called vArea (just so I can remember it’s virtual).

Screenshot - 10302014 - 05:49:20 PM

Note I’m adding a field with a expression. In this case I’m getting the area in Acres (Area in square feet / 43560). I’ve got an area of 82.736 Acres. As is usual the polygon is wrong and I’ve got to adjust it. So with their help I’m now readjusting the boundary from:

Beginning Polygon

Beginning Polygon

Adjusted Boundaries

Adjusted Boundaries

and just for fun I reopen the attribute table and:

Screenshot - 10302014 - 05:55:40 PM

 

 

 

My vArea has changed to 99.983 Acres. The virtual field updated. For the record this was all done with a shapefile. The only time you see behavior like this is (in my opinion) when you deal with a database, or a carefully worked script/plugin/extension, or for those of us who have dealt with a file based geodatabase (those will keep up with area but not calculations).

Once I remove the layer from QGIS the field Vanishes. So far the field has stayed if the layer stays in the QGIS project (save close and reopen a project).

It’s impressive. It’s cool. It’s Free and Open Source from the hard working developers of QGIS.

 

 

You may also like

TNGIC 2024

TNGIC 2024

So - if you're coming to the 2024 TNGIC (TN Geographic Information Council) meeting (April 9-11 2024) to talk about how no one understands what you do......I'm doing a workshop. What workshop? It's a new workshop. QGIS and LIDAR data. As to what I do with the class...

iNaturalist and QGIS

I am probably the worst for being able to properly name "things". There are big trees and little trees. There are the annoying bugs and the not so annoying bugs. There are ducks, birds, bigger birds, and the birds that hang out at my bird feeder. As much time as I...

Mergin Maps and DB Sync

Mergin Maps and DB Sync

I don't know if I would label this exercise as fun but I've learned alot. I don't do a ton of data collection these days. At one time a few years ago I was out in the field with Fulcrum, a laptop, and sketchy internet for days at a time. These days I'm hardly ever...