0

The area value I'm getting using the SQL term 'ST_Area' is markedly different from that gained from QGIS functions like $area, the area measure tool and area as a derived feature (all of which agree with one another).

I've tried three different CRS, one geographic and two projected, project CRS matches the sqlite layer. Changing the features shows that areas are definitely being updated.

Could anyone explain what 'ST_Area' is measuring and why it's not the same as Qgis measurements?

  • 2
    Give us some test data for reproducing your issue. – user30184 May 16 '16 at 10:33
  • What do you mean by 'area as a derived feature'? Also, what version of QGIS are you using? I have reproduced this with $area and ST_Area and see a 0.4% difference - small but worrying. – Simbamangu May 16 '16 at 11:02
  • I'm having trouble uploading anything, but the case is easy to replicate. In a new project create an sqlite layer (multipolygon) and draw a feature, save layer. In DB manager, create a table using CREATE VIEW area_table AS SELECT (ST_Area([geometry column])) AS area FROM [database name]. The values in table derived from 'ST_Area' are not the same as the values either measured or in the information panel derived area, or using $area function in field calculator. Qgis version is 2.14.0 – Isaacson May 16 '16 at 15:53
  • 2
    I can't explain the ST_Area differences, but in QGIS $area will calculate an ellipsoidal area using the project's CRS, whereas area(some_geometry) will strictly calculate a 2d planimetric area. That's why there's differences between the values of $area and area($geometry). – ndawson May 17 '16 at 0:37
  • 1
    Attach one multipolygon as WKT to guarantee that we all can play with identical data, as well and your SRID and results from ST_Area and $area. – user30184 May 17 '16 at 6:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.