Definition at line 577 of file geography_measurement.c.
References SPHEROID::a, SPHEROID::b, COLLECTIONTYPE, geography_length(), gserialized_get_srid(), gserialized_get_type(), LW_TRUE, lwgeom_free(), lwgeom_from_gserialized(), lwgeom_is_empty(), lwgeom_length_spheroid(), MULTIPOLYGONTYPE, PG_FUNCTION_INFO_V1(), POLYGONTYPE, SPHEROID::radius, s, and ovdump::type.
Referenced by geography_area().
587 g = PG_GETARG_GSERIALIZED_P(0);
593 PG_RETURN_FLOAT8(0.0);
602 PG_RETURN_FLOAT8(0.0);
606 use_spheroid = PG_GETARG_BOOL(1);
612 if ( ! use_spheroid )
621 elog(ERROR,
"lwgeom_length_spheroid returned length < 0.0");
628 PG_FREE_IF_COPY(g, 0);
629 PG_RETURN_FLOAT8(length);
uint32_t gserialized_get_type(const GSERIALIZED *s)
Extract the geometry type from the serialized form (it hides in the anonymous data area...
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
double lwgeom_length_spheroid(const LWGEOM *geom, const SPHEROID *s)
Calculate the geodetic length of a lwgeom on the unit sphere.
#define LW_TRUE
Return types for functions with status returns.
int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members) ...
int32_t gserialized_get_srid(const GSERIALIZED *s)
Extract the SRID from the serialized form (it is packed into three bytes so this is a handy function)...