FAQ:  What algorithm is used by ArcGIS for Desktop to determine the area of a polygon?

相关信息
Article ID: 40905
Software:
ArcGIS for Desktop Advanced 10.1
ArcGIS for Desktop Standard 10.1
ArcGIS for Desktop Basic 10.1
Platforms:
Windows XP, Server 2003, Vista, Server 2008, Windows 7

问题描述
What algorithm is used by ArcGIS for Desktop to determine the area of a polygon?
已邀请:

易智瑞技术支持

赞同来自:

解决方案
The algorithm used in ArcGIS to calculate the area of a polygon is called 'Area Calculation by Gauss'. Esri uses a normalized form of it to preserve numeric precision. This is a common algorithm.

The algorithm calculates the area for each ring (part) in a polygon. If the ring is clockwise (outer ring) the area is positive, and if the ring is counterclockwise (inner ring) the value will be negative.

A partial sum of a trapezoid's area is used where:






partialSums[0] - Array of double


cPoints - Number of points in the ring


points - Array of point structure, the structure as X and Y as attributes


yOrigin - Double equal to the Y value of the last point (cpoints-1)


The first trapezoid's area is:






partialSums[0] = (points[1].x - points[cPoints-1].x) * (points[0].y - yOrigin)


For each point starting at index 1:






for j = 1 to j < cPoints-1


partialSums[j] = (points[j+1].x - points[j-1].x) * (points[j].y - yOrigin)


If the ring contains non-linear segments, such as Circular Arc, Elliptic Arc, and Bezier Curve, a correction of the area is applied for each trapezoid.

The final area of the ring is:






SUM(PartialSums)/2


The final area of the polygon is:






SUM(Area of each ring)


Here is an example with the following points (one square ring) zz:






X0 = 0 ; Y0 = 0


X1 = 0 ; Y1 = 10


X2 = 10 ; Y2 = 10


X3 = 10 ; Y3 = 0


X4 = 0 ; Y4 = 0





partialSums(0) = (X0 - X4) * (Y0 - Y4) = (0 - 0) * (0 - 0) = 0


partialSums(1) = (X2 - X0) * (Y1 - Y4) = (10 - 0) * (10 - 0) = 100


partialSums(2) = (X3 - X1) * (Y2 - Y4) = (10 - 0) * (10 - 0) = 100


partialSums(3) = (X4 - X2) * (Y3 - Y4) = (0 - 10) * (0 - 0) = 0


There is no correction to apply in this case because only lines are used.






sum (partialSums)/2 = 200/2 = 100




For ArcObjects developers, area is defined as IArea::Area.


创建及修改时间
Created: 3/5/2013

Last Modified: 7/31/2013
原文链接
http://support.esri.com/en/kno ... 40905

要回复问题请先登录注册