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

◆ lwcollection_segmentize2d()

LWCOLLECTION * lwcollection_segmentize2d ( const LWCOLLECTION col,
double  dist 
)

Definition at line 251 of file lwcollection.c.

252{
253 uint32_t i, j;
254 LWGEOM** newgeoms;
255
256 if (!col->ngeoms) return lwcollection_clone(col);
257
258 newgeoms = lwalloc(sizeof(LWGEOM*) * col->ngeoms);
259 for (i = 0; i < col->ngeoms; i++)
260 {
261 newgeoms[i] = lwgeom_segmentize2d(col->geoms[i], dist);
262 if (!newgeoms[i])
263 {
264 for (j = 0; j < i; j++)
265 lwgeom_free(newgeoms[j]);
266 lwfree(newgeoms);
267 return NULL;
268 }
269 }
270
272 col->type, col->srid, NULL, col->ngeoms, newgeoms);
273}
void lwgeom_free(LWGEOM *geom)
Definition lwgeom.c:1246
void * lwalloc(size_t size)
Definition lwutil.c:227
void lwfree(void *mem)
Definition lwutil.c:248
LWGEOM * lwgeom_segmentize2d(const LWGEOM *line, double dist)
Definition lwgeom.c:799
LWCOLLECTION * lwcollection_construct(uint8_t type, int32_t srid, GBOX *bbox, uint32_t ngeoms, LWGEOM **geoms)
LWCOLLECTION * lwcollection_clone(const LWCOLLECTION *g)
Clone LWCOLLECTION object.
uint32_t ngeoms
Definition liblwgeom.h:580
uint8_t type
Definition liblwgeom.h:578
LWGEOM ** geoms
Definition liblwgeom.h:575
int32_t srid
Definition liblwgeom.h:576

References LWCOLLECTION::geoms, lwalloc(), lwcollection_clone(), lwcollection_construct(), lwfree(), lwgeom_free(), lwgeom_segmentize2d(), LWCOLLECTION::ngeoms, LWCOLLECTION::srid, and LWCOLLECTION::type.

Referenced by lwgeom_segmentize2d().

Here is the call graph for this function:
Here is the caller graph for this function: