PostGIS  2.3.8dev-r@@SVN_REVISION@@

◆ collectFacesWithEvenAncestors()

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

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

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

Referenced by LWGEOM_GEOS_buildArea().

1205 {
1206  GEOSGeometry **geoms = lwalloc(sizeof(GEOSGeometry*)*nfaces);
1207  GEOSGeometry *ret;
1208  unsigned int ngeoms = 0;
1209  int i;
1210 
1211  for (i=0; i<nfaces; ++i) {
1212  Face *f = faces[i];
1213  if ( countParens(f) % 2 ) continue; /* we skip odd parents geoms */
1214  geoms[ngeoms++] = GEOSGeom_clone(f->geom);
1215  }
1216 
1217  ret = GEOSGeom_createCollection(GEOS_MULTIPOLYGON, geoms, ngeoms);
1218  lwfree(geoms);
1219  return ret;
1220 }
void lwfree(void *mem)
Definition: lwutil.c:242
const GEOSGeometry * geom
static unsigned int countParens(const Face *f)
void * lwalloc(size_t size)
Definition: lwutil.c:227
Here is the call graph for this function:
Here is the caller graph for this function: