Definition at line 494 of file lwgeom_geos_split.c.
496 LWGEOM** split_vector=NULL;
498 size_t split_vector_capacity;
499 size_t split_vector_size=0;
502 split_vector_capacity=8;
503 split_vector =
lwalloc(split_vector_capacity *
sizeof(
LWGEOM*));
504 if ( ! split_vector )
506 lwerror(
"Out of virtual memory");
510 for (i=0; i<lwcoll_in->
ngeoms; ++i)
515 if ( ! split )
return NULL;
522 if ( split_vector_size + col->
ngeoms > split_vector_capacity )
525 split_vector_capacity += col->
ngeoms;
527 split_vector_capacity *
sizeof(
LWGEOM*));
528 if ( ! split_vector )
530 lwerror(
"Out of virtual memory");
535 for (j=0; j<col->
ngeoms; ++j)
538 split_vector[split_vector_size++] = col->
geoms[j];
546 NULL, split_vector_size, split_vector);
void * lwrealloc(void *mem, size_t size)
void * lwalloc(size_t size)
LWCOLLECTION * lwcollection_construct(uint8_t type, int32_t srid, GBOX *bbox, uint32_t ngeoms, LWGEOM **geoms)
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().