PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ basic_test()

static void basic_test ( void  )
static

Definition at line 158 of file cu_geos_cluster.c.

159 {
160  char* a = "LINESTRING (0 0, 1 1)";
161  char* b = "LINESTRING (1 1, 2 2)";
162  char* c = "LINESTRING (5 5, 6 6)";
163 
164  char* wkt_inputs_a[] = {a, b, c};
165  char* wkt_inputs_b[] = {b, c, a};
166  char* wkt_inputs_c[] = {c, a, b};
167 
168  char* expected_outputs_a[] = { "GEOMETRYCOLLECTION(LINESTRING (0 0, 1 1), LINESTRING (1 1, 2 2))",
169  "GEOMETRYCOLLECTION(LINESTRING (5 5, 6 6))"
170  };
171 
172  char* expected_outputs_b[] = { "GEOMETRYCOLLECTION(LINESTRING (1 1, 2 2), LINESTRING (0 0, 1 1))",
173  "GEOMETRYCOLLECTION(LINESTRING (5 5, 6 6))"
174  };
175 
176  char* expected_outputs_c[] = { "GEOMETRYCOLLECTION(LINESTRING (0 0, 1 1), LINESTRING (1 1, 2 2))",
177  "GEOMETRYCOLLECTION(LINESTRING (5 5, 6 6))"
178  };
179 
180  perform_cluster_intersecting_test(wkt_inputs_a, 3, expected_outputs_a, 2);
181  perform_cluster_intersecting_test(wkt_inputs_b, 3, expected_outputs_b, 2);
182  perform_cluster_intersecting_test(wkt_inputs_c, 3, expected_outputs_c, 2);
183 
184  perform_cluster_within_distance_test(0, wkt_inputs_a, 3, expected_outputs_a, 2);
185  perform_cluster_within_distance_test(0, wkt_inputs_b, 3, expected_outputs_b, 2);
186  perform_cluster_within_distance_test(0, wkt_inputs_c, 3, expected_outputs_c, 2);
187 }
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: