QGIS 2.6: Virtual Fields

Oct 30, 2014 | 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

FOSS4GNA 2026 – Post1 – Toasters

FOSS4GNA 2026 – Post1 – Toasters

I tell a lot of jokes that are only funny to me. That may be the worse type of joke - but I laugh and on some days that is the important thing. So my joke at FOSS4GNA 2026 was "I didn't watch 4 seasons of Battlestar Galactica for us to end up here...again". If you've...

FOSS4GNA 2026

Greetings from the Atlanta Airport at 7:10 AM. I am again flying during a time change - my body says it's 8:10 but overall - this is easier than flying in the spring when the time changes. I've already gotten lost twice and asked for directions once. So this will be...

The Aunt II: Adding Cemeteries

The Aunt II: Adding Cemeteries

In a previous post I talked about my aunt that died and we couldn't find the cemetery. Found it! Welcome to the Bethel Cemetery. I will tip my hat to the inherent creepiness of the whole thing. Who is rising second? So I want to add cemeteries to OSM. In my first...