| 1195 | } |
| 1196 | |
| 1197 | double 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. |
no test coverage detected