3

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?

1 Answer 1

4

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 GEOMETRYs 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!

7
  • so how do I transform it to meters? can you please let me know
    – analyst92
    Commented Sep 26, 2022 at 16:25
  • but the unit of measurement of SRID 4326 IS meters right?
    – analyst92
    Commented Sep 26, 2022 at 16:30
  • 2
    No, it is degree, 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!
    – geozelot
    Commented Sep 26, 2022 at 16:33
  • 1
    You can transform at query time, i.e. ST_ClusterDBSCAN(ST_Transform(geom, <target_srid>), ...)
    – geozelot
    Commented Sep 26, 2022 at 16:41
  • 1
    May you live a happy and blessed life, thanks so much!
    – analyst92
    Commented Sep 26, 2022 at 16:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.