PostGIS  2.1.10dev-r@@SVN_REVISION@@
LWCOLLECTION * lwcollection_segmentize ( LWCOLLECTION collection,
uint32_t  perQuad 
)

Definition at line 408 of file lwsegmentize.c.

References CIRCSTRINGTYPE, COLLECTIONTYPE, COMPOUNDTYPE, CURVEPOLYTYPE, LWCOLLECTION::geoms, lwalloc(), lwcircstring_segmentize(), lwcollection_construct(), lwcompound_segmentize(), lwcurvepoly_segmentize(), LWDEBUG, lwgeom_clone(), LWCOLLECTION::ngeoms, LWCOLLECTION::srid, and LWGEOM::type.

Referenced by lwgeom_segmentize().

409 {
410  LWCOLLECTION *ocol;
411  LWGEOM *tmp;
412  LWGEOM **geoms;
413  int i;
414 
415  LWDEBUG(2, "lwcollection_segmentize called.");
416 
417  geoms = lwalloc(sizeof(LWGEOM *)*collection->ngeoms);
418 
419  for (i=0; i<collection->ngeoms; i++)
420  {
421  tmp = collection->geoms[i];
422  switch (tmp->type)
423  {
424  case CIRCSTRINGTYPE:
425  geoms[i] = (LWGEOM *)lwcircstring_segmentize((LWCIRCSTRING *)tmp, perQuad);
426  break;
427  case COMPOUNDTYPE:
428  geoms[i] = (LWGEOM *)lwcompound_segmentize((LWCOMPOUND *)tmp, perQuad);
429  break;
430  case CURVEPOLYTYPE:
431  geoms[i] = (LWGEOM *)lwcurvepoly_segmentize((LWCURVEPOLY *)tmp, perQuad);
432  break;
433  case COLLECTIONTYPE:
434  geoms[i] = (LWGEOM *)lwcollection_segmentize((LWCOLLECTION *)tmp, perQuad);
435  break;
436  default:
437  geoms[i] = lwgeom_clone(tmp);
438  break;
439  }
440  }
441  ocol = lwcollection_construct(COLLECTIONTYPE, collection->srid, NULL, collection->ngeoms, geoms);
442  return ocol;
443 }
LWPOLY * lwcurvepoly_segmentize(const LWCURVEPOLY *curvepoly, uint32_t perQuad)
Definition: lwsegmentize.c:290
LWCOLLECTION * lwcollection_construct(uint8_t type, int srid, GBOX *bbox, uint32_t ngeoms, LWGEOM **geoms)
Definition: lwcollection.c:30
#define CURVEPOLYTYPE
Definition: liblwgeom.h:69
#define COMPOUNDTYPE
Definition: liblwgeom.h:68
#define LWDEBUG(level, msg)
Definition: lwgeom_log.h:50
LWLINE * lwcircstring_segmentize(const LWCIRCSTRING *icurve, uint32_t perQuad)
Definition: lwsegmentize.c:191
LWLINE * lwcompound_segmentize(const LWCOMPOUND *icompound, uint32_t perQuad)
Definition: lwsegmentize.c:243
LWGEOM ** geoms
Definition: liblwgeom.h:465
int32_t srid
Definition: liblwgeom.h:462
LWGEOM * lwgeom_clone(const LWGEOM *lwgeom)
Clone LWGEOM object.
Definition: lwgeom.c:351
uint8_t type
Definition: liblwgeom.h:352
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:67
void * lwalloc(size_t size)
Definition: lwutil.c:175
#define COLLECTIONTYPE
Definition: liblwgeom.h:66
LWCOLLECTION * lwcollection_segmentize(LWCOLLECTION *collection, uint32_t perQuad)
Definition: lwsegmentize.c:408

Here is the call graph for this function:

Here is the caller graph for this function: