214 WindowObject win_obj = PG_WINDOW_OBJECT();
215 uint32_t row = WinGetCurrentPosition(win_obj);
216 uint32_t ngeoms = WinGetPartitionRowCount(win_obj);
222 uint32_t* result_ids;
225 bool tolerance_is_null;
226 double tolerance = DatumGetFloat8(WinGetFuncArgCurrent(win_obj, 1, &tolerance_is_null));
229 if (tolerance_is_null || tolerance < 0)
231 lwpgerror(
"Tolerance must be a positive number", tolerance);
239 for (i = 0; i < ngeoms; i++)
247 lwpgerror(
"Error reading geometry.");
257 for (i = 0; i < ngeoms; i++)
266 lwpgerror(
"Error during clustering");
271 for (i = 0; i < ngeoms; i++)
void lwgeom_geos_error(const char *fmt,...)
int union_dbscan(LWGEOM **geoms, uint32_t num_geoms, UNIONFIND *uf, double eps, uint32_t min_points, char **is_in_cluster_ret)
void lwgeom_free(LWGEOM *geom)
void * lwalloc(size_t size)
#define LW_TRUE
Return types for functions with status returns.
static cluster_context * fetch_cluster_context(WindowObject win_obj, uint32_t ngeoms)
static LWGEOM * read_lwgeom_from_partition(WindowObject win_obj, uint32_t i, bool *is_null)
uint32_t * UF_get_collapsed_cluster_ids(UNIONFIND *uf, const char *is_in_cluster)
void UF_destroy(UNIONFIND *uf)
UNIONFIND * UF_create(uint32_t N)
cluster_entry clusters[1]