5

I am trying to use the QGIS Field Calculator to calculate the area of a feature. When I do this, the area returned is calculated using the planimetric method. This differs to $area which uses the ellipsoidal method.

When I try area(intersection(feature1, feature2), it returns the planimetric area, but I need the ellipsoidal area.

How can I change the method of the area command from planimetric to ellipsoid in QGIS? Or is there a way to get the ellipsoidal area of intersection(feature1, feature2) in Field Calculator?

7
  • 2
    Why do you need to change? $area already gives ellipsoidal area. Sep 22, 2020 at 18:47
  • This response isn't helpful. The question is not, WHY do I need this, it's HOW do I do it. There is clearly more going on in the background than this question outlines. You don't need to know why.
    – hojkoff
    Sep 23, 2020 at 8:09
  • 6
    I asked so, because there are two different methods to calculate an area in Field Calculator. 1. area($geometry) which returns the planimetric area, 2. $area which returns ellipsoidal area. Which method do you use to calculate the area of a feature? Sep 23, 2020 at 8:37
  • 2
    The question in my first comment is just an ordinary, a usual question that we, volunteer answerers, usually ask to understand what the post owner exactly needs and asks. Well, yes, I did understand your question as "How can I change area($geometry) ...." and I asked (in my first comment) like that because I was unsure you asked what I understood. Sep 23, 2020 at 10:38
  • 1
    I tried to make a new function in Field Calculator, I couldn't figure it out how to solve this problem. Though, it looks like the best way is to make a new custom expression function like area_v2(feature1, feature2). There is a simple tutorial here. Sep 24, 2020 at 21:49

1 Answer 1

2

You can transform the geometry inside the area() function of QGIS expression to a local CRS where the difference between planimetric and ellipsoidal measurements are minimal - be it UTM zone of your area of interest or any other.

As local CRS, I use EPSG:2056 for Switzerland for demonstration purpose. My polygon layer is in EPSG:3857, so the difference between planimetric and ellipsoidal measurements is high. I use this expression on the layer with layer CRS EPSG:3857 to get measurements in EPSG:2056:

area (
    transform (
        intersection ([feature1], [feature2]),
        'EPSG:3857',
        'EPSG:2056'
    )
)

All layers in EPSG:3857. Measurement of the intersection in the middle with the expression above: 956'301; intersection created as a separate layer and calculation of ellispoidal area: 956'281, so quite close: enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.