PostGIS  2.5.0dev-r@@SVN_REVISION@@
Datum LWGEOM_force_curve ( PG_FUNCTION_ARGS  )

Definition at line 549 of file lwgeom_functions_basic.c.

References dumpnode::geom, geometry_serialize(), lwgeom_as_curve(), and lwgeom_from_gserialized().

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 * geom
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)
LWGEOM * lwgeom_as_curve(const LWGEOM *lwgeom)
Create a new LWGEOM of the appropriate CURVE* type.
Definition: lwgeom.c:404

Here is the call graph for this function: