I'm trying to use postgis ST_withincluster function. But my knowledge over SQL seems a bit too fresh at the moment and I can't figure out by myself how I should proceed by reading posts like this one: Spatial clustering with PostGIS?. I've read some documentation and examples but still not manage to get what I want.
I have only one table "records" with the following attributes:
- longitude as float
- latitude as float
- longlat as st_point
My question is simple: what do I need to do to get a array of records grouped by cluster ? I know it might sound a bit 'noobish' but examples around appear really complex to me and intended to already aware devs.
I almost if not exactly in the same situation as this post: PostGIS - Dynamic Server-Side Clustering based on Zoom level (rails app, vue js google map). On the exception maybe that I'm starting from zero.
PS: Maybe my approach to the problem is irrelevant, also don't hesitate to tell if so.
minpoints=1it is similar toST_clusterWithin, but it is much simpler to retrieve the records that make each cluster – JGH May 27 '19 at 18:07