PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ 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  CU_ASSERT_STRING_EQUAL(s,"0110");
93 
94  cu_twkb("POINT(0 0)", 0, 0, 0, 0);
95  CU_ASSERT_STRING_EQUAL(s,"01000000");
96 
97  cu_twkb("POINT(0 0 0 0)", 0, 0, 0, 0);
98  CU_ASSERT_STRING_EQUAL(s,"01080300000000");
99 
100  /* Point with bounding box */
101  cu_twkb("POINT(0 0)", 0, 0, 0, TWKB_BBOX);
102  CU_ASSERT_STRING_EQUAL(s,"0101000000000000");
103  // printf("TWKB: %s\n",s);
104 
105  /* Adding a size paramters to X/Y */
106  cu_twkb("POINT(0 0)", 0, 0, 0, TWKB_SIZE);
107  CU_ASSERT_STRING_EQUAL(s,"0102020000");
108 
109  /* Adding a size paramters to X/Y/M */
110  cu_twkb("POINTM(0 0 0)", 0, 0, 0, TWKB_SIZE);
111  CU_ASSERT_STRING_EQUAL(s,"010A0203000000");
112 
113  /* Adding a size paramters to X/Y/Z/M */
114  cu_twkb("POINT(0 0 0 0)", 0, 0, 0, TWKB_SIZE);
115  CU_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  CU_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  CU_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 TWKB_SIZE
Definition: liblwgeom.h:2193
#define TWKB_BBOX
Definition: liblwgeom.h:2192

References 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: