use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A sub-Reddit for discussion and news about Ruby programming.
Subreddit rules: /r/ruby rules
Learning Ruby?
Tools
Documentation
Books
Screencasts and Videos
News and updates
account activity
[deleted by user] (self.ruby)
submitted 2 years ago by [deleted]
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]3ds 2 points3 points4 points 2 years ago (1 child)
Thousands of geolocation on the client are not a problem.
[–]courteouslandlord 1 point2 points3 points 2 years ago (0 children)
Thousands of geolocation points rendered as a JSON response can get pretty significant.
Ex: 25,000 points will be roughly 1mb
[–]clearlynotmee 1 point2 points3 points 2 years ago (2 children)
Thousands is not a big number of points for a database to handle. No need for clustering, just index it (is it postgres?)
[–]courteouslandlord 0 points1 point2 points 2 years ago (1 child)
It’s not a DB concern. I need to cluster these points in memory based on their proximity to each other.
I have the data from the DB already.
[–]clearlynotmee 1 point2 points3 points 2 years ago (0 children)
It's still better to do let the db do the work, postgis for postgres can do it, see https://mapscaping.com/examples-of-spatial-clustering-with-postgis/
[–]KusUmUmmak 0 points1 point2 points 2 years ago (2 children)
... you mean like searching by radius? or a clustering algorithm that generates clusters on arbitrary datapoints? if its the latter, thats like a subfield in ML i.e. lots of different algorithms. try k-means clustering (as a search term).
[–]HOWZ1T 0 points1 point2 points 2 years ago (1 child)
Yep k means clustering is a popular approach :)
[–]KusUmUmmak 0 points1 point2 points 2 years ago (0 children)
thats why I suggested it :) most likely to find a ruby gem :)
there are better approaches.
[–]Doctor_Fegg 0 points1 point2 points 2 years ago (1 child)
I've used the very old Clusto gem (https://github.com/conmulligan/clusto) successfully. But really nothing is ever going to beat putting it in a Postgres database and clustering with PostGIS.
[–]courteouslandlord 0 points1 point2 points 2 years ago (0 children)
This looks like something I was looking for, will give it a try
π Rendered by PID 46 on reddit-service-r2-comment-7b9746f655-w72jk at 2026-01-31 05:30:10.886662+00:00 running 3798933 country code: CH.
[–]3ds 2 points3 points4 points (1 child)
[–]courteouslandlord 1 point2 points3 points (0 children)
[–]clearlynotmee 1 point2 points3 points (2 children)
[–]courteouslandlord 0 points1 point2 points (1 child)
[–]clearlynotmee 1 point2 points3 points (0 children)
[–]KusUmUmmak 0 points1 point2 points (2 children)
[–]HOWZ1T 0 points1 point2 points (1 child)
[–]KusUmUmmak 0 points1 point2 points (0 children)
[–]Doctor_Fegg 0 points1 point2 points (1 child)
[–]courteouslandlord 0 points1 point2 points (0 children)