PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ collectFacesWithEvenAncestors()

static GEOSGeometry* collectFacesWithEvenAncestors ( Face **  faces,
int  nfaces 
)
static

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

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

Referenced by LWGEOM_GEOS_buildArea().

1234 {
1235  GEOSGeometry **geoms = lwalloc(sizeof(GEOSGeometry*)*nfaces);
1236  GEOSGeometry *ret;
1237  unsigned int ngeoms = 0;
1238  int i;
1239 
1240  for (i=0; i<nfaces; ++i) {
1241  Face *f = faces[i];
1242  if ( countParens(f) % 2 ) continue; /* we skip odd parents geoms */
1243  geoms[ngeoms++] = GEOSGeom_clone(f->geom);
1244  }
1245 
1246  ret = GEOSGeom_createCollection(GEOS_MULTIPOLYGON, geoms, ngeoms);
1247  lwfree(geoms);
1248  return ret;
1249 }
void lwfree(void *mem)
Definition: lwutil.c:244
const GEOSGeometry * geom
static unsigned int countParens(const Face *f)
void * lwalloc(size_t size)
Definition: lwutil.c:229
Here is the call graph for this function:
Here is the caller graph for this function: