PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ LWGEOM_line_desegmentize()

Datum LWGEOM_line_desegmentize ( PG_FUNCTION_ARGS  )

Definition at line 127 of file lwgeom_sqlmm.c.

128{
129 GSERIALIZED *geom = PG_GETARG_GSERIALIZED_P(0);
130 GSERIALIZED *ret;
131 LWGEOM *igeom = NULL, *ogeom = NULL;
132
133 POSTGIS_DEBUG(2, "LWGEOM_line_desegmentize.");
134
135 igeom = lwgeom_from_gserialized(geom);
136 ogeom = lwgeom_unstroke(igeom);
137 lwgeom_free(igeom);
138
139 if (ogeom == NULL)
140 {
141 PG_FREE_IF_COPY(geom, 0);
142 PG_RETURN_NULL();
143 }
144
145 ret = geometry_serialize(ogeom);
146 lwgeom_free(ogeom);
147 PG_FREE_IF_COPY(geom, 0);
148 PG_RETURN_POINTER(ret);
149}
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition lwgeom.c:1246
LWGEOM * lwgeom_unstroke(const LWGEOM *geom)
Convert linearized type into arc type, de-linearizing the strokes where possible.
Definition lwstroke.c:1271

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

Here is the call graph for this function: