Definition at line 109 of file cu_surface.c.
References cu_error_msg, cu_error_msg_reset(), LWGEOM::flags, FLAGS_GET_M, gserialized_from_lwgeom(), gserialized_get_type(), LW_PARSER_CHECK_NONE, lwfree(), lwgeom_free(), lwgeom_from_wkt(), lwgeom_to_ewkt(), LWGEOM::srid, SRID_UNKNOWN, TINTYPE, and LWGEOM::type.
Referenced by surface_suite_setup().
122 CU_ASSERT_STRING_EQUAL(
"TIN EMPTY", tmp);
131 CU_ASSERT_STRING_EQUAL(
"TIN(((0 1,2 3,4 5,0 1)))", tmp);
140 CU_ASSERT_STRING_EQUAL(
"TINM(((0 1 2,3 4 5,6 7 8,0 1 2)))", tmp);
146 CU_ASSERT_STRING_EQUAL(
"can not mix dimensionality in a geometry",
cu_error_msg);
152 CU_ASSERT_STRING_EQUAL(
"geometry contains non-closed rings",
cu_error_msg);
158 CU_ASSERT_STRING_EQUAL(
"geometry contains non-closed rings",
cu_error_msg);
164 CU_ASSERT_STRING_EQUAL(
"geometry contains non-closed rings",
cu_error_msg);
170 CU_ASSERT_STRING_EQUAL(
"triangle must have exactly 4 points",
cu_error_msg);
176 CU_ASSERT_STRING_EQUAL(
"triangle must have exactly 4 points",
cu_error_msg);
182 CU_ASSERT_STRING_EQUAL(
"parse error - invalid geometry",
cu_error_msg);
191 CU_ASSERT_STRING_EQUAL(
"TIN EMPTY", tmp);
196 geom =
lwgeom_from_wkt(
"TIN(((0 0 0,0 0 1,0 1 0,0 0 0)),((0 0 0,0 1 0,1 0 0,0 0 0)),((0 0 0,1 0 0,0 0 1,0 0 0)),((1 0 0,0 1 0,0 0 1,1 0 0)))",
LW_PARSER_CHECK_NONE);
201 CU_ASSERT_STRING_EQUAL(
"TIN(((0 0 0,0 0 1,0 1 0,0 0 0)),((0 0 0,0 1 0,1 0 0,0 0 0)),((0 0 0,1 0 0,0 0 1,0 0 0)),((1 0 0,0 1 0,0 0 1,1 0 0)))", tmp);
206 geom =
lwgeom_from_wkt(
"TIN(((0 0 0 0,0 0 1 0,0 1 0 2,0 0 0 0)),((0 0 0 0,0 1 0 0,1 0 0 4,0 0 0 0)),((0 0 0 0,1 0 0 0,0 0 1 6,0 0 0 0)),((1 0 0 0,0 1 0 0,0 0 1 0,1 0 0 0)))",
LW_PARSER_CHECK_NONE);
212 CU_ASSERT_STRING_EQUAL(
"TIN(((0 0 0 0,0 0 1 0,0 1 0 2,0 0 0 0)),((0 0 0 0,0 1 0 0,1 0 0 4,0 0 0 0)),((0 0 0 0,1 0 0 0,0 0 1 6,0 0 0 0)),((1 0 0 0,0 1 0 0,0 0 1 0,1 0 0 0)))", tmp);
217 geom =
lwgeom_from_wkt(
"SRID=4326;TIN(((0 0 0,0 0 1,0 1 0,0 0 0)),((0 0 0,0 1 0,1 0 0,0 0 0)),((0 0 0,1 0 0,0 0 1,0 0 0)),((1 0 0,0 1 0,0 0 1,1 0 0)))",
LW_PARSER_CHECK_NONE);
220 CU_ASSERT_EQUAL(geom->
srid, 4326);
222 CU_ASSERT_STRING_EQUAL(
"SRID=4326;TIN(((0 0 0,0 0 1,0 1 0,0 0 0)),((0 0 0,0 1 0,1 0 0,0 0 0)),((0 0 0,1 0 0,0 0 1,0 0 0)),((1 0 0,0 1 0,0 0 1,1 0 0)))", tmp);
uint32_t gserialized_get_type(const GSERIALIZED *s)
Extract the geometry type from the serialized form (it hides in the anonymous data area...
char * lwgeom_to_ewkt(const LWGEOM *lwgeom)
Return an alloced string.
void lwgeom_free(LWGEOM *geom)
LWGEOM * lwgeom_from_wkt(const char *wkt, const char check)
#define LW_PARSER_CHECK_NONE
void cu_error_msg_reset()
#define SRID_UNKNOWN
Unknown SRID value.
#define FLAGS_GET_M(flags)
GSERIALIZED * gserialized_from_lwgeom(LWGEOM *geom, size_t *size)
Allocate a new GSERIALIZED from an LWGEOM.
char cu_error_msg[MAX_CUNIT_ERROR_LENGTH+1]