PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ lwcollection_segmentize2d()

LWCOLLECTION* lwcollection_segmentize2d ( const LWCOLLECTION coll,
double  dist 
)

Definition at line 250 of file lwcollection.c.

251 {
252  uint32_t i, j;
253  LWGEOM** newgeoms;
254 
255  if (!col->ngeoms) return lwcollection_clone(col);
256 
257  newgeoms = lwalloc(sizeof(LWGEOM*) * col->ngeoms);
258  for (i = 0; i < col->ngeoms; i++)
259  {
260  newgeoms[i] = lwgeom_segmentize2d(col->geoms[i], dist);
261  if (!newgeoms[i])
262  {
263  for (j = 0; j < i; j++)
264  lwgeom_free(newgeoms[j]);
265  lwfree(newgeoms);
266  return NULL;
267  }
268  }
269 
270  return lwcollection_construct(
271  col->type, col->srid, NULL, col->ngeoms, newgeoms);
272 }
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1144
LWGEOM * lwgeom_segmentize2d(const LWGEOM *line, double dist)
Definition: lwgeom.c:762
void lwfree(void *mem)
Definition: lwutil.c:244
void * lwalloc(size_t size)
Definition: lwutil.c:229
LWCOLLECTION * lwcollection_clone(const LWCOLLECTION *g)
Clone LWCOLLECTION object.
Definition: lwcollection.c:123
LWCOLLECTION * lwcollection_construct(uint8_t type, int srid, GBOX *bbox, uint32_t ngeoms, LWGEOM **geoms)
Definition: lwcollection.c:43
unsigned int uint32_t
Definition: uthash.h:78

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: