Calculate the geodetic length of a lwgeom on the unit sphere.
The result will have to by multiplied by the real radius to get the real length.
Definition at line 3281 of file lwgeodetic.c.
References LWCOLLECTION::geoms, LINETYPE, lwerror(), lwgeom_is_empty(), lwtype_is_collection(), MULTIPOINTTYPE, LWCOLLECTION::ngeoms, LWPOLY::nrings, POINTTYPE, POLYGONTYPE, ptarray_length_spheroid(), LWPOLY::rings, TRIANGLETYPE, ovdump::type, and LWGEOM::type.
Referenced by geography_length(), geography_perimeter(), LWGEOM_length2d_ellipsoid(), and LWGEOM_length_ellipsoid_linestring().
3285 double length = 0.0;
3304 for ( i = 0; i < poly->
nrings; i++ )
3318 for ( i = 0; i < col->
ngeoms; i++ )
3325 lwerror(
"unsupported type passed to lwgeom_length_sphere");
double lwgeom_length_spheroid(const LWGEOM *geom, const SPHEROID *s)
Calculate the geodetic length of a lwgeom on the unit sphere.
double ptarray_length_spheroid(const POINTARRAY *pa, const SPHEROID *s)
int lwtype_is_collection(uint8_t type)
Determine whether a type number is a collection or not.
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members) ...
void lwerror(const char *fmt,...)
Write a notice out to the error handler.