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

◆ LWGEOM_force_curve()

Datum LWGEOM_force_curve ( PG_FUNCTION_ARGS  )

Definition at line 549 of file lwgeom_functions_basic.c.

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

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

Here is the call graph for this function: