My SRID is 4326 for the points_geom column. Here is my code:
SELECT row_id, ST_ClusterDBSCAN(points_geom, eps := 100, minPoints := 5)
OVER(ORDER BY row_id) AS cluster_id FROM subset_cr
Am I correct in assuming eps = 100 means 100 metres?
No. You are looking at an eps
distance of 100 degrees!
ST_ClusterDBSCAN
currently has no signature accepting a GEOGRAPHY
, so your only option is to ST_Transform
your input GEOMETRY
s to a suitable projection defining meter as its primary unit of measure.
Except for the results of distance functions, where the measurement unit of the returned value can depend on either parameters or types, all functions in the PostGIS environment return the same unit of measurement specified in the Coordinate Reference System of the input geometry values!
EPSG:4326
is a geographic refrence system. See my update; you will have to find a suitable projection for your area of interest that uses meter!
ST_ClusterDBSCAN(ST_Transform(geom, <target_srid>), ...)