360{
364 double length = 0.0;
365
366
368 {
370 PG_RETURN_FLOAT8(0.0);
371 }
372
375 PG_FREE_IF_COPY(geom, 0);
376
377
378 if ( length < 0.0 )
379 {
380 elog(ERROR, "lwgeom_length_spheroid returned length < 0.0");
381 PG_RETURN_NULL();
382 }
383
384
385 PG_RETURN_FLOAT8(length);
386}
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.
static int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members)