PostGIS  2.2.7dev-r@@SVN_REVISION@@
static GEOSGeometry* collectFacesWithEvenAncestors ( Face **  faces,
int  nfaces 
)
static

Definition at line 1124 of file liblwgeom/lwgeom_geos.c.

References countParens(), Face_t::geom, lwalloc(), and lwfree().

Referenced by LWGEOM_GEOS_buildArea().

1125 {
1126  GEOSGeometry **geoms = lwalloc(sizeof(GEOSGeometry*)*nfaces);
1127  GEOSGeometry *ret;
1128  unsigned int ngeoms = 0;
1129  int i;
1130 
1131  for (i=0; i<nfaces; ++i) {
1132  Face *f = faces[i];
1133  if ( countParens(f) % 2 ) continue; /* we skip odd parents geoms */
1134  geoms[ngeoms++] = GEOSGeom_clone(f->geom);
1135  }
1136 
1137  ret = GEOSGeom_createCollection(GEOS_MULTIPOLYGON, geoms, ngeoms);
1138  lwfree(geoms);
1139  return ret;
1140 }
void lwfree(void *mem)
Definition: lwutil.c:214
const GEOSGeometry * geom
static unsigned int countParens(const Face *f)
void * lwalloc(size_t size)
Definition: lwutil.c:199

Here is the call graph for this function:

Here is the caller graph for this function: