290{
291 WindowObject win_obj = PG_WINDOW_OBJECT();
292 uint32_t row = WinGetCurrentPosition(win_obj);
293 uint32_t ngeoms = WinGetPartitionRowCount(win_obj);
295
296 if (row == 0)
297 {
298 uint32_t i;
299 uint32_t* result_ids;
300 GEOSGeometry** geoms =
lwalloc(ngeoms *
sizeof(GEOSGeometry*));
302
304
306
307 for (i = 0; i < ngeoms; i++)
308 {
309 bool geom_is_null;
312
313 if (!geoms[i])
314 {
315 lwpgerror("Error reading geometry.");
316 PG_RETURN_NULL();
317 }
318 }
319
322
323 for (i = 0; i < ngeoms; i++)
324 {
325 GEOSGeom_destroy(geoms[i]);
326 }
328
330 {
332 lwpgerror("Error during clustering");
333 PG_RETURN_NULL();
334 }
335
337 for (i = 0; i < ngeoms; i++)
338 {
340 }
341
344 }
345
347 PG_RETURN_NULL();
348
350}
void lwgeom_geos_error(const char *fmt,...)
int union_intersecting_pairs(GEOSGeometry **geoms, uint32_t num_geoms, UNIONFIND *uf)
void * lwalloc(size_t size)
#define LW_TRUE
Return types for functions with status returns.
static GEOSGeometry * read_geos_from_partition(WindowObject win_obj, uint32_t i, bool *is_null)
static cluster_context * fetch_cluster_context(WindowObject win_obj, uint32_t ngeoms)
void UF_destroy(UNIONFIND *uf)
UNIONFIND * UF_create(uint32_t N)
uint32_t * UF_get_collapsed_cluster_ids(UNIONFIND *uf, const char *is_in_cluster)
cluster_entry clusters[1]