PostGIS  2.2.7dev-r@@SVN_REVISION@@
LWCOLLECTION * lwcollection_stroke ( const LWCOLLECTION collection,
uint32_t  perQuad 
)

Definition at line 406 of file lwstroke.c.

References CIRCSTRINGTYPE, COLLECTIONTYPE, COMPOUNDTYPE, CURVEPOLYTYPE, LWCOLLECTION::geoms, lwalloc(), lwcircstring_stroke(), lwcollection_construct(), lwcompound_stroke(), lwcurvepoly_stroke(), LWDEBUG, lwgeom_clone(), MULTICURVETYPE, MULTISURFACETYPE, LWCOLLECTION::ngeoms, LWCOLLECTION::srid, and LWGEOM::type.

Referenced by lwgeom_stroke().

407 {
408  LWCOLLECTION *ocol;
409  LWGEOM *tmp;
410  LWGEOM **geoms;
411  int i;
412 
413  LWDEBUG(2, "lwcollection_stroke called.");
414 
415  geoms = lwalloc(sizeof(LWGEOM *)*collection->ngeoms);
416 
417  for (i=0; i<collection->ngeoms; i++)
418  {
419  tmp = collection->geoms[i];
420  switch (tmp->type)
421  {
422  case CIRCSTRINGTYPE:
423  geoms[i] = (LWGEOM *)lwcircstring_stroke((LWCIRCSTRING *)tmp, perQuad);
424  break;
425  case COMPOUNDTYPE:
426  geoms[i] = (LWGEOM *)lwcompound_stroke((LWCOMPOUND *)tmp, perQuad);
427  break;
428  case CURVEPOLYTYPE:
429  geoms[i] = (LWGEOM *)lwcurvepoly_stroke((LWCURVEPOLY *)tmp, perQuad);
430  break;
431  case MULTICURVETYPE:
432  case MULTISURFACETYPE:
433  case COLLECTIONTYPE:
434  geoms[i] = (LWGEOM *)lwcollection_stroke((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 }
#define MULTICURVETYPE
Definition: liblwgeom.h:80
LWCOLLECTION * lwcollection_construct(uint8_t type, int srid, GBOX *bbox, uint32_t ngeoms, LWGEOM **geoms)
Definition: lwcollection.c:30
#define CURVEPOLYTYPE
Definition: liblwgeom.h:79
#define COMPOUNDTYPE
Definition: liblwgeom.h:78
#define LWDEBUG(level, msg)
Definition: lwgeom_log.h:50
LWCOLLECTION * lwcollection_stroke(const LWCOLLECTION *collection, uint32_t perQuad)
Definition: lwstroke.c:406
LWLINE * lwcircstring_stroke(const LWCIRCSTRING *icurve, uint32_t perQuad)
Definition: lwstroke.c:190
LWPOLY * lwcurvepoly_stroke(const LWCURVEPOLY *curvepoly, uint32_t perQuad)
Definition: lwstroke.c:289
LWGEOM ** geoms
Definition: liblwgeom.h:493
LWLINE * lwcompound_stroke(const LWCOMPOUND *icompound, uint32_t perQuad)
Definition: lwstroke.c:242
int32_t srid
Definition: liblwgeom.h:490
LWGEOM * lwgeom_clone(const LWGEOM *lwgeom)
Clone LWGEOM object.
Definition: lwgeom.c:395
#define MULTISURFACETYPE
Definition: liblwgeom.h:81
uint8_t type
Definition: liblwgeom.h:380
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:77
void * lwalloc(size_t size)
Definition: lwutil.c:199
#define COLLECTIONTYPE
Definition: liblwgeom.h:76

Here is the call graph for this function:

Here is the caller graph for this function: