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

Definition at line 422 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().

423 {
424  LWCOLLECTION *ocol;
425  LWGEOM *tmp;
426  LWGEOM **geoms;
427  int i;
428 
429  LWDEBUG(2, "lwcollection_stroke called.");
430 
431  geoms = lwalloc(sizeof(LWGEOM *)*collection->ngeoms);
432 
433  for (i=0; i<collection->ngeoms; i++)
434  {
435  tmp = collection->geoms[i];
436  switch (tmp->type)
437  {
438  case CIRCSTRINGTYPE:
439  geoms[i] = (LWGEOM *)lwcircstring_stroke((LWCIRCSTRING *)tmp, perQuad);
440  break;
441  case COMPOUNDTYPE:
442  geoms[i] = (LWGEOM *)lwcompound_stroke((LWCOMPOUND *)tmp, perQuad);
443  break;
444  case CURVEPOLYTYPE:
445  geoms[i] = (LWGEOM *)lwcurvepoly_stroke((LWCURVEPOLY *)tmp, perQuad);
446  break;
447  case MULTICURVETYPE:
448  case MULTISURFACETYPE:
449  case COLLECTIONTYPE:
450  geoms[i] = (LWGEOM *)lwcollection_stroke((LWCOLLECTION *)tmp, perQuad);
451  break;
452  default:
453  geoms[i] = lwgeom_clone(tmp);
454  break;
455  }
456  }
457  ocol = lwcollection_construct(COLLECTIONTYPE, collection->srid, NULL, collection->ngeoms, geoms);
458  return ocol;
459 }
#define MULTICURVETYPE
Definition: liblwgeom.h:94
LWCOLLECTION * lwcollection_construct(uint8_t type, int srid, GBOX *bbox, uint32_t ngeoms, LWGEOM **geoms)
Definition: lwcollection.c:43
#define CURVEPOLYTYPE
Definition: liblwgeom.h:93
#define COMPOUNDTYPE
Definition: liblwgeom.h:92
#define LWDEBUG(level, msg)
Definition: lwgeom_log.h:83
LWCOLLECTION * lwcollection_stroke(const LWCOLLECTION *collection, uint32_t perQuad)
Definition: lwstroke.c:422
LWLINE * lwcircstring_stroke(const LWCIRCSTRING *icurve, uint32_t perQuad)
Definition: lwstroke.c:206
LWPOLY * lwcurvepoly_stroke(const LWCURVEPOLY *curvepoly, uint32_t perQuad)
Definition: lwstroke.c:305
LWGEOM ** geoms
Definition: liblwgeom.h:508
LWLINE * lwcompound_stroke(const LWCOMPOUND *icompound, uint32_t perQuad)
Definition: lwstroke.c:258
int32_t srid
Definition: liblwgeom.h:505
LWGEOM * lwgeom_clone(const LWGEOM *lwgeom)
Clone LWGEOM object.
Definition: lwgeom.c:408
#define MULTISURFACETYPE
Definition: liblwgeom.h:95
uint8_t type
Definition: liblwgeom.h:395
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:91
void * lwalloc(size_t size)
Definition: lwutil.c:227
#define COLLECTIONTYPE
Definition: liblwgeom.h:90

Here is the call graph for this function:

Here is the caller graph for this function: