PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ LWGEOM_force_curve()

Datum LWGEOM_force_curve ( PG_FUNCTION_ARGS  )

Definition at line 555 of file lwgeom_functions_basic.c.

556{
557 GSERIALIZED *geom = PG_GETARG_GSERIALIZED_P(0);
559 LWGEOM *lwgeom;
560 LWGEOM *ogeom;
561
562 POSTGIS_DEBUG(2, "LWGEOM_force_curve called");
563
564 /* TODO: early out if input is already a curve */
565
566 lwgeom = lwgeom_from_gserialized(geom);
567 ogeom = lwgeom_as_curve(lwgeom);
568
569 result = geometry_serialize(ogeom);
570
571 PG_FREE_IF_COPY(geom, 0);
572
573 PG_RETURN_POINTER(result);
574}
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.
LWGEOM * lwgeom_as_curve(const LWGEOM *lwgeom)
Create a new LWGEOM of the appropriate CURVE* type.
Definition lwgeom.c:448

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

Here is the call graph for this function: