PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ LWGEOM_force_curve()

Datum LWGEOM_force_curve ( PG_FUNCTION_ARGS  )

Definition at line 552 of file lwgeom_functions_basic.c.

553 {
554  GSERIALIZED *geom = PG_GETARG_GSERIALIZED_P(0);
555  GSERIALIZED *result;
556  LWGEOM *lwgeom;
557  LWGEOM *ogeom;
558 
559  POSTGIS_DEBUG(2, "LWGEOM_force_curve called");
560 
561  /* TODO: early out if input is already a curve */
562 
563  lwgeom = lwgeom_from_gserialized(geom);
564  ogeom = lwgeom_as_curve(lwgeom);
565 
566  result = geometry_serialize(ogeom);
567 
568  PG_FREE_IF_COPY(geom, 0);
569 
570  PG_RETURN_POINTER(result);
571 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
LWGEOM * lwgeom_as_curve(const LWGEOM *lwgeom)
Create a new LWGEOM of the appropriate CURVE* type.
Definition: lwgeom.c:411
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)

References geometry_serialize(), lwgeom_as_curve(), and lwgeom_from_gserialized().

Here is the call graph for this function: