1

If one uses arcpy to calculate areas for a field in metric units on a polygon shapefile in a geographic coordinate system it will work, and give you plausible results. According to the documentation it uses 'a geodesic algorithm' to calculate distances but the documentation doesn't talk about how areas are calculated. How is it producing results in square kilometers in the following code and how does this calculated area compare in accuracy compared to projecting the data into an equal-area projection before calculating the area?

result_file = settings.get_boundary_file_results_location(boundary_short_name)
area_field_name = settings.NEW_FIELD_NAMES['Area square kilometers']
arcpy.AddField_management(result_file,
                          area_field_name,
                          "FLOAT")
expression = "{0}".format("!SHAPE.area@SQUAREKILOMETERS!")
arcpy.CalculateField_management(result_file, area_field_name, expression, "PYTHON_9.3")

And the properties of the shapefile:

enter image description here

Edit: There is a closed but nonetheless useful question here that deals with some of this: ArcGIS Length and Area Calculation Scenarios

Alexander
  • 938
  • 8
  • 14
  • in general it's a length-minimizing curve trough a bunch of differential equations. for Arc you can read about in the esri blog – ymirsson Dec 04 '15 at 13:31
  • Thanks, that blog doesn't mention anything explicitly about calculating areas though... just distances between features. – Alexander Dec 04 '15 at 13:40
  • my guess: with known distances between the vertices (ie. edges) in linear units it calculates the area via gauss's formula – ymirsson Dec 04 '15 at 14:06
  • 2
    Have you actually tried researching what a "geodesic algorithm" is? The problem is a rooted in partial differential equations which are only solvable through iterative means, and using integrals to slice areas into approximate solutions. The details are too complex for a three paragraph answer, so you'll either need to accept that Esri's programmers appear to know what they're doing, or become a geodesist (at which point you'll be able to quibble about 5-parameter, 7-parameter, and 9-parameter algorithms and 0.0001% discrepancies with the best of them) – Vince Dec 04 '15 at 15:12
  • Thanks Vince, my question wasn't as clear as it could have been, so I edited it slightly. My question is more specifically about how these areas are calculated because the documentation doesn't seem to say. – Alexander Dec 04 '15 at 15:54
  • 2
    I'd assume an integration approach, like the Trapezoid Rule. In theory, the question should be how favorably a projection compares to geodetic means, not the other way around. You certainly have the tools to answer this, by creating a custom Albers or Lambert (or both) projection for each shape, and measuring the resulting area. – Vince Dec 04 '15 at 17:07

0 Answers0