PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ LWGEOM_force_curve()

Datum LWGEOM_force_curve ( PG_FUNCTION_ARGS  )

Definition at line 533 of file lwgeom_functions_basic.c.

References dumpnode::geom, geometry_serialize(), lwgeom_as_curve(), LWGEOM_force_sfs(), lwgeom_from_gserialized(), and PG_FUNCTION_INFO_V1().

Referenced by LWGEOM_force_multi().

534 {
535  GSERIALIZED *geom = PG_GETARG_GSERIALIZED_P(0);
536  GSERIALIZED *result;
537  LWGEOM *lwgeom;
538  LWGEOM *ogeom;
539 
540  POSTGIS_DEBUG(2, "LWGEOM_force_curve called");
541 
542  /* TODO: early out if input is already a curve */
543 
544  lwgeom = lwgeom_from_gserialized(geom);
545  ogeom = lwgeom_as_curve(lwgeom);
546 
547  result = geometry_serialize(ogeom);
548 
549  PG_FREE_IF_COPY(geom, 0);
550 
551  PG_RETURN_POINTER(result);
552 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
LWGEOM * geom
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)
LWGEOM * lwgeom_as_curve(const LWGEOM *lwgeom)
Create a new LWGEOM of the appropriate CURVE* type.
Definition: lwgeom.c:324
Here is the call graph for this function:
Here is the caller graph for this function: