Hacker News new | past | comments | ask | show | jobs | submit login

I figure you're just rounding latlons to 2 decimal places and putting people in buckets?



This is indeed very similar to how initial sorting of the database is done. To improve accuracy (over performance) further sorting is done.

Like mentioned the non-linearity with regard to latitude makes standard trigonometry useless. In my case I opted for the haversine formula (https://en.wikipedia.org/wiki/Haversine_formula) this is pretty accurate on the small range of 1km


Latlons will not get you meters with accuracy. You need to use Vincenty's formulae.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: