PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ test_twkb_out_point()

static void test_twkb_out_point ( void  )
static

Definition at line 88 of file cu_out_twkb.c.

89{
90
91 cu_twkb("POINT EMPTY", 0, 0, 0, 0);
92 ASSERT_STRING_EQUAL(s,"0110");
93
94 cu_twkb("POINT(0 0)", 0, 0, 0, 0);
95 ASSERT_STRING_EQUAL(s,"01000000");
96
97 cu_twkb("POINT(0 0 0 0)", 0, 0, 0, 0);
98 ASSERT_STRING_EQUAL(s,"01080300000000");
99
100 /* Point with bounding box */
101 cu_twkb("POINT(0 0)", 0, 0, 0, TWKB_BBOX);
102 ASSERT_STRING_EQUAL(s,"0101000000000000");
103 // printf("TWKB: %s\n",s);
104
105 /* Adding a size parameters to X/Y */
106 cu_twkb("POINT(0 0)", 0, 0, 0, TWKB_SIZE);
107 ASSERT_STRING_EQUAL(s,"0102020000");
108
109 /* Adding a size parameters to X/Y/M */
110 cu_twkb("POINTM(0 0 0)", 0, 0, 0, TWKB_SIZE);
111 ASSERT_STRING_EQUAL(s,"010A0203000000");
112
113 /* Adding a size parameters to X/Y/Z/M */
114 cu_twkb("POINT(0 0 0 0)", 0, 0, 0, TWKB_SIZE);
115 ASSERT_STRING_EQUAL(s,"010A030400000000");
116
117 /* Since the third dimension is Z it shall get a precision of 1 decimal (third argument) */
118 cu_twkb("POINTZ(1 1 1)", 0,1,2, 0);
119 ASSERT_STRING_EQUAL(s,"010845020214");
120
121 /* Since the third dimension is M it shall get a precision of 2 decimals (fourth argument) */
122 cu_twkb("POINTM(1 1 1)", 0,1,2, 0);
123 // printf("\n%s\n", s);
124 ASSERT_STRING_EQUAL(s,"0108460202C801");
125}
static void cu_twkb(char *wkt, int8_t prec_xy, int8_t prec_z, int8_t prec_m, uint8_t variant)
Definition cu_out_twkb.c:55
static char * s
Definition cu_out_twkb.c:24
#define ASSERT_STRING_EQUAL(o, e)
#define TWKB_SIZE
Definition liblwgeom.h:2228
#define TWKB_BBOX
Definition liblwgeom.h:2227

References ASSERT_STRING_EQUAL, cu_twkb(), s, TWKB_BBOX, and TWKB_SIZE.

Referenced by twkb_out_suite_setup().

Here is the call graph for this function:
Here is the caller graph for this function: