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

It was part of a bigger project. I still have some code related to converting OSM data to json on my github: https://github.com/jillesvangurp/osm2geojson

Mainly the problem isn't Elasticsearch but dealing with openstreetmap tags and reconstructing polygons from ways, nodes, and relations. Otherwise, even back then Elasticsearch scaled fine; so no issues on that front. And it's pretty well suited for this type of stuff.

We had a largish Hetzner server (50 euro/month) with 32 GB and a quad core xeon that did the indexing. But basically that part was fine. I wrote some simple code that simply pulled out nearby street segments and then calculated perpendicular distance to each of them using some simple high school math and simply picked the nearest. And from there a simple contains query would produce neighborhoods, cities, countries, etc.

The why part was that I was building a location data startup at the time and we were interested in figuring out localities, neighborhoods, and other areas of interest from raw data with coordinates. The startup failed but the idea was kind of cool. So this was a simple reverse geocoder that I knocked out because the existing ones were kind of limited (also rate limited). And Opencage did not exist yet.




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

Search: