301{
302 int i = 0;
303 struct gserialized_empty_cases {
304 const char* wkt;
305 int isempty;
306 };
307
308 struct gserialized_empty_cases cases[] = {
309 { "POINT EMPTY", 1 },
310 { "POINT(1 1)", 0 },
311 { "LINESTRING EMPTY", 1 },
312 { "MULTILINESTRING EMPTY", 1 },
313 { "MULTILINESTRING(EMPTY)", 1 },
314 { "MULTILINESTRING(EMPTY,EMPTY)", 1 },
315 { "MULTILINESTRING(EMPTY,(0 0,1 1))", 0 },
316 { "MULTILINESTRING((0 0,1 1),EMPTY)", 0 },
317 { "MULTILINESTRING(EMPTY,(0 0,1 1),EMPTY)", 0 },
318 { "MULTILINESTRING(EMPTY,EMPTY,EMPTY)", 1 },
319 { "GEOMETRYCOLLECTION(POINT EMPTY,MULTILINESTRING(EMPTY,EMPTY,EMPTY))", 1 },
320 { "GEOMETRYCOLLECTION(POINT EMPTY,MULTILINESTRING(EMPTY),POINT(1 1))", 0 },
321 { "GEOMETRYCOLLECTION(POINT EMPTY,MULTILINESTRING(EMPTY, (0 0)),POINT EMPTY)", 0 },
322 { "GEOMETRYCOLLECTION(POLYGON EMPTY,POINT EMPTY,MULTILINESTRING(EMPTY,EMPTY),POINT EMPTY)", 1 },
323 { "GEOMETRYCOLLECTION(POLYGON EMPTY,GEOMETRYCOLLECTION(POINT EMPTY),MULTILINESTRING(EMPTY,EMPTY),POINT EMPTY)", 1 },
324 { NULL, 0 }
325 };
326
327 while( cases[i].wkt )
328 {
329
333
334 CU_ASSERT_EQUAL(ie, cases[i].isempty);
337 i++;
338 }
339}
int gserialized1_is_empty(const GSERIALIZED *g)
Check if a GSERIALIZED is empty without deserializing first.
GSERIALIZED * gserialized1_from_lwgeom(LWGEOM *geom, size_t *size)
Allocate a new GSERIALIZED from an LWGEOM.
void lwgeom_free(LWGEOM *geom)
#define LW_PARSER_CHECK_NONE
LWGEOM * lwgeom_from_wkt(const char *wkt, const char check)