MCPcopy Create free account
hub / github.com/MapServer/MapServer / msGetPolygonArea

Function msGetPolygonArea

mapprimitive.c:1197–1210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1195}
1196
1197double msGetPolygonArea(shapeObj *p)
1198{
1199 int i;
1200 double area=0;
1201
1202 for(i=0; i<p->numlines; i++) {
1203 if(msIsOuterRing(p, i))
1204 area += getRingArea(&(p->line[i]));
1205 else
1206 area -= getRingArea(&(p->line[i])); /* hole */
1207 }
1208
1209 return area;
1210}
1211
1212/*
1213** Computes the center of gravity for a polygon based on it's largest outer ring only.

Callers 1

yyparseFunction · 0.85

Calls 2

msIsOuterRingFunction · 0.85
getRingAreaFunction · 0.85

Tested by

no test coverage detected