PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ LWGEOM_force_curve()

Datum LWGEOM_force_curve ( PG_FUNCTION_ARGS  )

Definition at line 548 of file lwgeom_functions_basic.c.

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

Referenced by LWGEOM_force_multi().

549 {
550  GSERIALIZED *geom = PG_GETARG_GSERIALIZED_P(0);
551  GSERIALIZED *result;
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 }
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:373
Here is the call graph for this function:
Here is the caller graph for this function: