PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ LWGEOM_line_desegmentize()

Datum LWGEOM_line_desegmentize ( PG_FUNCTION_ARGS  )

Definition at line 84 of file lwgeom_sqlmm.c.

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

Referenced by LWGEOM_curve_segmentize().

85 {
86  GSERIALIZED *geom = PG_GETARG_GSERIALIZED_P(0);
87  GSERIALIZED *ret;
88  LWGEOM *igeom = NULL, *ogeom = NULL;
89 
90  POSTGIS_DEBUG(2, "LWGEOM_line_desegmentize.");
91 
92  igeom = lwgeom_from_gserialized(geom);
93  ogeom = lwgeom_unstroke(igeom);
94  lwgeom_free(igeom);
95 
96  if (ogeom == NULL)
97  {
98  PG_FREE_IF_COPY(geom, 0);
99  PG_RETURN_NULL();
100  }
101 
102  ret = geometry_serialize(ogeom);
103  lwgeom_free(ogeom);
104  PG_FREE_IF_COPY(geom, 0);
105  PG_RETURN_POINTER(ret);
106 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1050
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)
LWGEOM * lwgeom_unstroke(const LWGEOM *geom)
Definition: lwstroke.c:842
Here is the call graph for this function:
Here is the caller graph for this function: