799 GEOSGeometry **vgeoms;
803 nvgeoms = GEOSGetNumGeometries(gin);
804 if ( nvgeoms == -1 ) {
809 vgeoms =
lwalloc(
sizeof(GEOSGeometry*) * nvgeoms );
811 lwerror(
"LWGEOM_GEOS_makeValidCollection: out of memory");
815 for ( i=0; i<nvgeoms; ++i ) {
818 while (i--) GEOSGeom_destroy(vgeoms[i]);
826 gout = GEOSGeom_createCollection(GEOS_GEOMETRYCOLLECTION, vgeoms, nvgeoms);
830 for ( i=0; i<nvgeoms; ++i ) GEOSGeom_destroy(vgeoms[i]);
832 lwerror(
"GEOSGeom_createCollection() threw an error: %s",
char lwgeom_geos_errmsg[LWGEOM_GEOS_ERRMSG_MAXSIZE]
static GEOSGeometry * LWGEOM_GEOS_makeValid(const GEOSGeometry *)
void * lwalloc(size_t size)
void lwerror(const char *fmt,...)
Write a notice out to the error handler.