PostGIS  3.1.6dev-r@@SVN_REVISION@@

◆ LWGEOM_force_curve()

Datum LWGEOM_force_curve ( PG_FUNCTION_ARGS  )

Definition at line 548 of file lwgeom_functions_basic.c.

549 {
550  GSERIALIZED *geom = PG_GETARG_GSERIALIZED_P(0);
552  LWGEOM *lwgeom;
553  LWGEOM *ogeom;
554 
555  POSTGIS_DEBUG(2, "LWGEOM_force_curve called");
556 
557  /* TODO: early out if input is already a curve */
558 
559  lwgeom = lwgeom_from_gserialized(geom);
560  ogeom = lwgeom_as_curve(lwgeom);
561 
562  result = geometry_serialize(ogeom);
563 
564  PG_FREE_IF_COPY(geom, 0);
565 
566  PG_RETURN_POINTER(result);
567 }
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:403

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

Here is the call graph for this function: