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

◆ basic_test()

static void basic_test ( void  )
static

Definition at line 160 of file cu_geos_cluster.c.

161{
162 char* a = "LINESTRING (0 0, 1 1)";
163 char* b = "LINESTRING (1 1, 2 2)";
164 char* c = "LINESTRING (5 5, 6 6)";
165
166 char* wkt_inputs_a[] = {a, b, c};
167 char* wkt_inputs_b[] = {b, c, a};
168 char* wkt_inputs_c[] = {c, a, b};
169
170 char* expected_outputs_a[] = { "GEOMETRYCOLLECTION(LINESTRING (0 0, 1 1), LINESTRING (1 1, 2 2))",
171 "GEOMETRYCOLLECTION(LINESTRING (5 5, 6 6))"
172 };
173
174 char* expected_outputs_b[] = { "GEOMETRYCOLLECTION(LINESTRING (1 1, 2 2), LINESTRING (0 0, 1 1))",
175 "GEOMETRYCOLLECTION(LINESTRING (5 5, 6 6))"
176 };
177
178 char* expected_outputs_c[] = { "GEOMETRYCOLLECTION(LINESTRING (0 0, 1 1), LINESTRING (1 1, 2 2))",
179 "GEOMETRYCOLLECTION(LINESTRING (5 5, 6 6))"
180 };
181
182 perform_cluster_intersecting_test(wkt_inputs_a, 3, expected_outputs_a, 2);
183 perform_cluster_intersecting_test(wkt_inputs_b, 3, expected_outputs_b, 2);
184 perform_cluster_intersecting_test(wkt_inputs_c, 3, expected_outputs_c, 2);
185
186 perform_cluster_within_distance_test(0, wkt_inputs_a, 3, expected_outputs_a, 2);
187 perform_cluster_within_distance_test(0, wkt_inputs_b, 3, expected_outputs_b, 2);
188 perform_cluster_within_distance_test(0, wkt_inputs_c, 3, expected_outputs_c, 2);
189}
static void perform_cluster_within_distance_test(double tolerance, char **wkt_inputs, uint32_t num_inputs, char **wkt_outputs, uint32_t num_outputs)
static void perform_cluster_intersecting_test(char **wkt_inputs, uint32_t num_inputs, char **wkt_outputs, uint32_t num_outputs)

References perform_cluster_intersecting_test(), and perform_cluster_within_distance_test().

Referenced by geos_cluster_suite_setup().

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