I'm trying to create a new field defined as the area of the convex hull of the current feature, in the Field Calculator in QGIS 2.8.
Calculating the area of the current feature is easy ($area), and calculating the convex hull of the current feature is easy (convexHull($geometry)), but I can't find any way to calculate the area of that resulting geometry (as opposed to the geometry of the current feature).
I think I need to be able to either:
- Apply an area calculation to that convex hull geometry in the Field Calculator -- this is what I'd prefer; or
- Write a custom function -- there appears to be a free-standing area function in the Function Editor, but I can't figure out how to get a simple custom function defined and called properly; shouldn't need any arguments, as it's just the area of the convex hull of the current geometry; or
- Create a new layer from an interim attribute that just contains the geometry of the convex hull -- then I could calculate the areas of those features in the new layer
Any suggestions on any of these approaches?