Calculate the area of an LWGEOM.
Calculate the geodetic area of a lwgeom on the sphere.
Anything except POLYGON, MULTIPOLYGON and GEOMETRYCOLLECTION return zero immediately. Multi's recurse, polygons calculate external ring area and subtract internal ring area. A GBOX is required to calculate an outside point.
Definition at line 2031 of file lwgeodetic.c.
2032{
2035
2036 assert(lwgeom);
2037
2038
2040 return 0.0;
2041
2042
2044
2045
2047 return 0.0;
2048
2049
2051 {
2053 uint32_t i;
2054 double area = 0.0;
2055
2056
2058 return 0.0;
2059
2060
2062
2063
2064 for ( i = 1; i < poly->
nrings; i++ )
2065 {
2067 }
2068 return area;
2069 }
2070
2071
2073 {
2075 uint32_t i;
2076 double area = 0.0;
2077
2078 for ( i = 0; i < col->
ngeoms; i++ )
2079 {
2081 }
2082 return area;
2083 }
2084
2085
2086 return 0.0;
2087}
double ptarray_area_sphere(const POINTARRAY *pa)
Returns the area of the ring (ring must be closed) in square radians (surface of the sphere is 4*PI).
double lwgeom_area_sphere(const LWGEOM *lwgeom, const SPHEROID *spheroid)
Calculate the area of an LWGEOM.
static int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members)
References COLLECTIONTYPE, LWCOLLECTION::geoms, lwgeom_area_sphere(), lwgeom_is_empty(), MULTIPOLYGONTYPE, LWCOLLECTION::ngeoms, LWPOLY::nrings, POLYGONTYPE, ptarray_area_sphere(), SPHEROID::radius, LWPOLY::rings, and LWGEOM::type.
Referenced by geography_area(), geography_centroid_from_mpoly(), lwgeom_area_sphere(), test_lwgeom_area_sphere(), and test_spheroid_area().