122{
125 uint32_t i;
126 int outtype = lwcoll_in->
type;
127
129 if ( ! wrap_geoms )
130 {
131 lwerror(
"Out of virtual memory");
132 return NULL;
133 }
134
135 for (i=0; i<lwcoll_in->
ngeoms; ++i)
136 {
137 LWDEBUGF(3,
"Wrapping collection element %d", i);
139
140 if ( ! wrap_geoms[i] ) {
141 uint32_t j;
142 lwnotice(
"Error wrapping geometry, cleaning up");
143 for (j = 0; j < i; j++)
144 {
145 lwnotice(
"cleaning geometry %d (%p)", j, (
void *) wrap_geoms[j]);
147 }
150 return NULL;
151 }
153 if (
MULTITYPE[wrap_geoms[i]->type] != outtype )
154 {
156 }
157 }
158 }
159
160
162 lwcoll_in->
ngeoms, wrap_geoms);
163
164 return out;
165}
LWCOLLECTION * lwcollection_construct(uint8_t type, int32_t srid, GBOX *bbox, uint32_t ngeoms, LWGEOM **geoms)
void lwgeom_free(LWGEOM *geom)
void * lwalloc(size_t size)
uint8_t MULTITYPE[NUMTYPES]
Look-up for the correct MULTI* type promotion for singleton types.
#define LWDEBUGF(level, msg,...)
void lwnotice(const char *fmt,...) __attribute__((format(printf
Write a notice out to the notice handler.
void void lwerror(const char *fmt,...) __attribute__((format(printf
Write a notice out to the error handler.
LWGEOM * lwgeom_wrapx(const LWGEOM *lwgeom_in, double cutx, double amount)
wrap geometry on given cut x value