Skip to content

Instantly share code, notes, and snippets.

@dbauszus-glx
Created April 20, 2018 17:06
Show Gist options
  • Save dbauszus-glx/0a7f0ced5b4228d9561116f5fb10a0c1 to your computer and use it in GitHub Desktop.
Save dbauszus-glx/0a7f0ced5b4228d9561116f5fb10a0c1 to your computer and use it in GitHub Desktop.
Cluster comparisson
SELECT
dbscan_cid,
st_union(geom) geom
FROM (
SELECT
ST_ClusterDBSCAN(geom, 0.23, 1) OVER () dbscan_cid,
geom
FROM gb_retailpoint
) kmeans GROUP BY dbscan_cid;
SELECT
kmeans_cid,
st_union(geom) geom
FROM (
SELECT
ST_ClusterKMeans(geom, 50) OVER () kmeans_cid,
geom
FROM gb_retailpoint
) kmeans GROUP BY kmeans_cid;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment