I am working on a project that requires the calculation of the area of a polygon by two different methods. I need to know what algorithm QGIS uses to calculate the area of a polygon. I know ESRI ArcGIS uses the shoelace (Gaussian) method and am looking for GIS software that uses a different method.
-
2If you will be comparing these implementations in any way, be aware that the areas could disagree for reasons other than the area-computation algorithm. For instance, the GISes may internally change coordinates in order to fit within an area of interest or predefined project boundaries. Some GISes use floating point coordinates and others use (scaled) integer coordinates. Also, it would be practically meaningless to do timing comparisons unless you could identify and control for various overhead operations. So in the end, given no comparison of time or accuracy will be valid, what's the point?– whuberCommented May 23, 2013 at 14:51
Add a comment
|
1 Answer
QGIS uses the GEOS library for geometry operations:
https://github.com/qgis/Quantum-GIS/blob/master/src/core/qgsgeometry.cpp
GEOS uses the shoelace formula:
http://trac.osgeo.org/geos/browser/trunk/src/algorithm/CGAlgorithms.cpp#L304
OGR also uses the shoelace formula:
http://trac.osgeo.org/gdal/browser/trunk/gdal/ogr/ogrlinearring.cpp#L461