Hi everyone, I’m trying to replicate a clustering ...
# community-help
g
Hi everyone, I’m trying to replicate a clustering behavior similar to PostGIS in Typesense. I have a dataset of documents with lat/lng, and I want to group (cluster) results by proximity to a given point (lat/lng) within a defined radius. For example, cluster all points within 5km of each other around a reference point. The idea is to generate a set of geographic buckets or clusters, each containing nearby points, and then get a count of documents per cluster (or even centroid + count if possible). Typesense allows sorting and filtering with _geo_point, but I haven’t found a way to group or cluster by geographic proximity dynamically. Is this possible natively in Typesense? Or do I need to run a geo-clustering algorithm externally to pre compute or even doing the job after retrieving results? Thanks in advance for your input ! Any pattern or workaround you’ve used would be great to hear.
d
Hi @Gabriel Delattre. Did you have any success with creating clustering system for geo points? I'm assessing right now if I should stick with Elasticsearch (geospatial API is wonderful to work, but the maintenance of whole thing is dreadful experience 🤢 ) or try to build upon Typesense which overall seems like much more streamlined solution.
g
Nop, clustering thing client side. I really hope the typesense team would work on this. Having clusters from API would be wonderful. You can do like @Alan Martini suggested and complete the issue with your use case !
🙏 1
d
Thx for fast response and from what I can see in the issue my use case is exactly the same (which isn't strange because it's fairly common need). I'll link there the elastic docs with geohash api explained and ask if its possible to implement something similar in the typesense backend.
👍 1
g
Would be awesome to help the team build such a feature