Returns the area of the ring (ring must be closed) in square radians (surface of the sphere is 4*PI).
Definition at line 1807 of file lwgeodetic.c.
1815 if ( ! pa || pa->
npoints < 4 )
1823 for ( i = 2; i < pa->
npoints-1; i++ )
const POINT2D * getPoint2d_cp(const POINTARRAY *pa, uint32_t n)
Returns a POINT2D pointer into the POINTARRAY serialized_ptlist, suitable for reading from.
void geographic_point_init(double lon, double lat, GEOGRAPHIC_POINT *g)
Initialize a geographic point.
static double sphere_signed_area(const GEOGRAPHIC_POINT *a, const GEOGRAPHIC_POINT *b, const GEOGRAPHIC_POINT *c)
Computes the spherical area of a triangle.
Datum area(PG_FUNCTION_ARGS)
Point in spherical coordinates on the world.
References area(), geographic_point_init(), getPoint2d_cp(), POINTARRAY::npoints, sphere_signed_area(), POINT2D::x, and POINT2D::y.
Referenced by lwgeom_area_sphere().