r/selfhosted • u/Alternative-Bike8120 • 8d ago
Product Announcement Self-host planet scale geocoding with 630M+ records in a <30 GB memory-mapped index
Geocoding converts street addresses into geographic coordinates, making it possible to use them in applications like delivery routing, store locators, and mapping services.
If you're doing this at scale, API costs add up quickly. One team was quoted $14,000 by Google to geocode 2.8 million addresses.
I figured there should be a way to run this yourself but projects like Pelias, an open-source geocoder, estimates about 16 hours on a 36-core machine for a full planet build. The resulting index takes up about 450 GB in Elasticsearch
I’ve been working on OpenGeocode, a self-hosted geocoder built on OpenStreetMap and OpenAddresses. The global search index holds 630M+ records in a single file under 30 GB. To serve it, you run one binary or mount the file in Docker. There’s no separate database to maintain, and updating the index is a file swap.
You can also build an index for just the area you need. Planet index builds in about 5 hours on a 9 GB memory budget. The Netherlands index built in under two minutes.
The TypeScript SDK has client adapters for Google, HERE, Mapbox, and Precisely. Supported endpoints return the vendor’s response format using data from your own Pack. Supported APIs and response examples
I've also made the prebuilt USA index available for free. No build required. Download the USA Pack
Not done yet. There's still plenty more to get right.
•
u/asimovs-auditor 8d ago edited 8d ago
Expand the replies to this comment to learn how AI was used in this post/project.
3
u/mattsteg43 8d ago •
Why use this instead of something established like photon? Feels kinda astroturfed and oversold
13
u/buttplugs4life4me 8d ago
Seems pretty cool. Not really commenting on AI, but I'm hoping you use it responsibly. Addresses, Geocoding and so on are all areas that have been very entrenched into cloud APIs and desperately need some open alternatives that are more lightweight and easier to host
12
u/FckngModest 8d ago
Dawarich's author made Atlas a while ago for self-hosting as well, btw. https://github.com/dawarich-app/atlas
And he even has a way-cheaper-than-google option as a paid hosted service as well if you don't want to host yourself: https://chibigeo.com/
1
u/[deleted] 7d ago
[removed] — view removed comment