PostGIS  3.3.9dev-r@@SVN_REVISION@@

◆ LWGEOM_force_curve()

Datum LWGEOM_force_curve ( PG_FUNCTION_ARGS  )

Definition at line 553 of file lwgeom_functions_basic.c.

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

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

Here is the call graph for this function: