Bug report #16820

Wrong area calculations in 2.18.10 - they are correct in 2.18.1

Added by magerlin - over 7 years ago. Updated over 7 years ago.

Status:Closed
Priority:High
Assignee:-
Category:Field calculator
Affected QGIS version:2.18.10 Regression?:Yes
Operating System:Win 7, 64 bit Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:Yes Copied to github as #:24719

Description

Calculating polygon areas in version 2.18.10 in the field calculator using $area may lead to areas that are far wrong (factor 100) compared to calculation using Area($geometry). Version 2.18.1 does not have this error - See attached screenshot of attribute table where the area calculations are:

Area: $area in version 2.18.10
Area_planM: area($geometry) in version 2.18.10

Area_21801: $area in version 2.18.1
Ar_21801_PL: ea($geometry) in version 2.18.1

Test_Area[1].zip - Test shape file with area attributes from 2.18.10 and 2.18.1 (4.56 KB) magerlin -, 2017-07-09 03:14 PM

Screenshot_2017-07-06_18.png - Attribute table screenshot (43.8 KB) magerlin -, 2017-07-09 03:20 PM

Screenshot_20170709_151130.png (174 KB) Giovanni Manghi, 2017-07-09 04:12 PM

Screenshot_20170709_151638.png (172 KB) Giovanni Manghi, 2017-07-09 04:16 PM

Associated revisions

Revision d8503936
Added by Nyall Dawson over 7 years ago

Fix incorrect area calculation in corner cases (fix #16820)

In certain circumstances very proximal nodes could cause instability
in the ellipsoidal area calculation.

Port (slightly tweaked) fix from grass changeset 71167 for same issue,
and add a unit test

Revision 61bb2ac0
Added by Nyall Dawson over 7 years ago

Merge pull request #4828 from nyalldawson/fix_16820

Fix incorrect area calculation in corner cases (fix #16820)

Revision a0d64129
Added by Nyall Dawson over 7 years ago

Fix incorrect area calculation in corner cases (fix #16820)

In certain circumstances very proximal nodes could cause instability
in the ellipsoidal area calculation.

Port (slightly tweaked) fix from grass changeset 71167 for same issue,
and add a unit test

(cherry-picked from d850393)

Revision e6dc103c
Added by Nyall Dawson over 7 years ago

Merge pull request #4829 from nyalldawson/fix_16820_218

Fix incorrect area calculation in corner cases (fix #16820)

History

#1 Updated by Giovanni Manghi over 7 years ago

  • Status changed from Open to Feedback

Can you say if the area values were right in any 2.18 release after 2.18.1 and before 2.18.10? thanks.

#2 Updated by Giovanni Manghi over 7 years ago

Just made a test on 2.18.10 in Linux and results are identical with the two formulas and identical to the ones you show for 2.18.1

#3 Updated by Giovanni Manghi over 7 years ago

Did the same on Win7, same results.

#4 Updated by Nyall Dawson over 7 years ago

  • % Done changed from 0 to 100
  • Status changed from Feedback to Closed

Also available in: Atom PDF