PostGIS  3.0.6dev-r@@SVN_REVISION@@

◆ perform_cluster_intersecting_test()

static void perform_cluster_intersecting_test ( char **  wkt_inputs,
uint32_t  num_inputs,
char **  wkt_outputs,
uint32_t  num_outputs 
)
static

Definition at line 81 of file cu_geos_cluster.c.

82 {
83  GEOSGeometry** geos_results;
84  LWGEOM** lw_results;
85  uint32_t num_clusters;
86 
87  LWGEOM** expected_outputs = WKTARRAY2LWGEOM(wkt_outputs, num_outputs);
88  LWGEOM** lw_inputs = WKTARRAY2LWGEOM(wkt_inputs, num_inputs);
89  GEOSGeometry** geos_inputs = LWGEOMARRAY2GEOS(lw_inputs, num_inputs);
90 
91  cluster_intersecting(geos_inputs, num_inputs, &geos_results, &num_clusters);
92  CU_ASSERT_EQUAL(num_outputs, num_clusters);
93 
94  lw_results = GEOSARRAY2LWGEOM(geos_results, num_clusters);
95 
96  assert_all_results_found(lw_results, num_clusters, expected_outputs, num_outputs);
97 
98  /* Cleanup */
99  uint32_t i;
100  for(i = 0; i < num_clusters; i++)
101  {
102  GEOSGeom_destroy(geos_results[i]);
103  }
104  lwfree(geos_inputs);
105  lwfree(geos_results);
106 
107  for(i = 0; i < num_outputs; i++)
108  {
109  lwgeom_free(expected_outputs[i]);
110  lwgeom_free(lw_results[i]);
111  }
112  lwfree(expected_outputs);
113  lwfree(lw_results);
114 
115  for(i = 0; i < num_inputs; i++)
116  {
117  lwgeom_free(lw_inputs[i]);
118  }
119  lwfree(lw_inputs);
120 }
static GEOSGeometry ** LWGEOMARRAY2GEOS(LWGEOM **lw_array, size_t num_geoms)
static void assert_all_results_found(LWGEOM **results, size_t num_outputs, LWGEOM **expected, size_t num_expected_outputs)
static LWGEOM ** GEOSARRAY2LWGEOM(GEOSGeometry **geos_array, size_t num_geoms)
static LWGEOM ** WKTARRAY2LWGEOM(char **wkt_array, size_t num_geoms)
int cluster_intersecting(GEOSGeometry **geoms, uint32_t num_geoms, GEOSGeometry ***clusterGeoms, uint32_t *num_clusters)
Takes an array of GEOSGeometry* and constructs an array of GEOSGeometry*, where each element in the c...
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1138
void lwfree(void *mem)
Definition: lwutil.c:242

References assert_all_results_found(), cluster_intersecting(), GEOSARRAY2LWGEOM(), lwfree(), lwgeom_free(), LWGEOMARRAY2GEOS(), and WKTARRAY2LWGEOM().

Referenced by basic_test(), empty_inputs_test(), multipoint_test(), nonsequential_test(), and single_input_test().

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