I was looking to use
ST_ClusterDBSCAN on a set of points that also have a type. So I want the points to be clustered by type, so that points having different types won't end up in the same cluster. Since
ST_ClusterDBSCAN is windowed function I thought I could simply
PARTITION BY type column and that will do. Something like:
ST_ClusterDBSCAN(point, eps := 20, minpoints := 3) OVER(PARTITION BY type) AS cid,
However I still end up having same
cid assigned to points of different type.
Obviously there's something I misunderstand either about clustering or windowed functions in general?
cids differently with and without of
PARTITION BY type so partitioning definitely affects the outcome somehow, I'm just not sure how exactly. Obviously not the way one would expect.