Search code examples
databasegispostgispgadminqgis

Area size of a polygon different in QGIS and PGadmin


I have a shapefile which is returning a different area value in pgAdmin than in FME, Cadcorp SIS and QGIS and I don't know why it is different in pgAdmin.

The setting used in pgAdmin are:

SELECT ST_Area(GEOMETRY) FROM greenbelt_shp

Can someone can tell me why it is returning a different value?

enter image description here


Solution

  • Setting the ellipsoid (in the measurement option) from Airy 1830 to none/planimetric in QGIS allowed for $area feature in the field calculator to return the correct result.

    The error still remained in PostGIS when exporting the original .SHP through Cadcorp SIS, the issue was caused by self-intersections in the polygon.

    I found the best fix to be running an update on the geometry field with the ST_MakeVaild command.

    I used : update tablename set geometryname = ST_MakeValid (geometryname)

    You can also replicate the shapefile into an internal overlay and run the Simplify tool on the new internal overlay then export this file to your database. The Simplify tool removes self-intersections from your polygon within Cadcorp SIS.