Definition at line 489 of file lwgeom_geos_split.c.
491 LWGEOM** split_vector=NULL;
493 size_t split_vector_capacity;
494 size_t split_vector_size=0;
497 split_vector_capacity=8;
498 split_vector =
lwalloc(split_vector_capacity *
sizeof(
LWGEOM*));
499 if ( ! split_vector )
501 lwerror(
"Out of virtual memory");
505 for (i=0; i<lwcoll_in->
ngeoms; ++i)
510 if ( ! split )
return NULL;
517 if ( split_vector_size + col->
ngeoms > split_vector_capacity )
520 split_vector_capacity += col->
ngeoms;
522 split_vector_capacity *
sizeof(
LWGEOM*));
523 if ( ! split_vector )
525 lwerror(
"Out of virtual memory");
530 for (j=0; j<col->
ngeoms; ++j)
533 split_vector[split_vector_size++] = col->
geoms[j];
541 NULL, split_vector_size, split_vector);
void * lwrealloc(void *mem, size_t size)
LWCOLLECTION * lwcollection_construct(uint8_t type, int srid, GBOX *bbox, uint32_t ngeoms, LWGEOM **geoms)
void * lwalloc(size_t size)
LWCOLLECTION * lwgeom_as_lwcollection(const LWGEOM *lwgeom)
#define SRID_UNKNOWN
Unknown SRID value.
LWGEOM * lwgeom_split(const LWGEOM *lwgeom_in, const LWGEOM *blade_in)
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
References COLLECTIONTYPE, LWCOLLECTION::geoms, lwalloc(), lwcollection_construct(), lwerror(), lwfree(), lwgeom_as_lwcollection(), lwgeom_split(), lwrealloc(), LWCOLLECTION::ngeoms, LWGEOM::srid, LWCOLLECTION::srid, and SRID_UNKNOWN.
Referenced by lwgeom_split().