PostGIS  2.3.8dev-r@@SVN_REVISION@@

◆ LWGEOM_line_desegmentize()

Datum LWGEOM_line_desegmentize ( PG_FUNCTION_ARGS  )

Definition at line 98 of file lwgeom_sqlmm.c.

References geometry_serialize(), lwgeom_free(), lwgeom_from_gserialized(), and lwgeom_unstroke().

Referenced by LWGEOM_curve_segmentize().

99 {
100  GSERIALIZED *geom = PG_GETARG_GSERIALIZED_P(0);
101  GSERIALIZED *ret;
102  LWGEOM *igeom = NULL, *ogeom = NULL;
103 
104  POSTGIS_DEBUG(2, "LWGEOM_line_desegmentize.");
105 
106  igeom = lwgeom_from_gserialized(geom);
107  ogeom = lwgeom_unstroke(igeom);
108  lwgeom_free(igeom);
109 
110  if (ogeom == NULL)
111  {
112  PG_FREE_IF_COPY(geom, 0);
113  PG_RETURN_NULL();
114  }
115 
116  ret = geometry_serialize(ogeom);
117  lwgeom_free(ogeom);
118  PG_FREE_IF_COPY(geom, 0);
119  PG_RETURN_POINTER(ret);
120 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1063
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)
LWGEOM * lwgeom_unstroke(const LWGEOM *geom)
Definition: lwstroke.c:858
Here is the call graph for this function:
Here is the caller graph for this function: