PostGIS  2.1.10dev-r@@SVN_REVISION@@
Datum LWGEOM_line_desegmentize ( PG_FUNCTION_ARGS  )

Definition at line 85 of file lwgeom_sqlmm.c.

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

86 {
87  GSERIALIZED *geom = (GSERIALIZED *)PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
88  GSERIALIZED *ret;
89  LWGEOM *igeom = NULL, *ogeom = NULL;
90 
91  POSTGIS_DEBUG(2, "LWGEOM_line_desegmentize.");
92 
93  igeom = lwgeom_from_gserialized(geom);
94  ogeom = lwgeom_desegmentize(igeom);
95  lwgeom_free(igeom);
96 
97  if (ogeom == NULL)
98  {
99  PG_FREE_IF_COPY(geom, 0);
100  PG_RETURN_NULL();
101  }
102 
103  ret = geometry_serialize(ogeom);
104  lwgeom_free(ogeom);
105  PG_FREE_IF_COPY(geom, 0);
106  PG_RETURN_POINTER(ret);
107 }
LWGEOM * lwgeom_desegmentize(LWGEOM *geom)
Definition: lwsegmentize.c:841
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1006
LWGEOM * geom
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)

Here is the call graph for this function: