PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ LWGEOM_force_curve()

Datum LWGEOM_force_curve ( PG_FUNCTION_ARGS  )

Definition at line 556 of file lwgeom_functions_basic.c.

557 {
558  GSERIALIZED *geom = PG_GETARG_GSERIALIZED_P(0);
560  LWGEOM *lwgeom;
561  LWGEOM *ogeom;
562 
563  POSTGIS_DEBUG(2, "LWGEOM_force_curve called");
564 
565  /* TODO: early out if input is already a curve */
566 
567  lwgeom = lwgeom_from_gserialized(geom);
568  ogeom = lwgeom_as_curve(lwgeom);
569 
570  result = geometry_serialize(ogeom);
571 
572  PG_FREE_IF_COPY(geom, 0);
573 
574  PG_RETURN_POINTER(result);
575 }
char result[OUT_DOUBLE_BUFFER_SIZE]
Definition: cu_print.c:262
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: