frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

The offline geocoder we wanted

7•gipsyjaeger•19h ago
What is this?

This is an offline reverse geocoder written in Python. Given a latitude–longitude pair, it returns the correct administrative region such as country, state, or district without calling any external APIs. This avoids API costs, rate limits, and network dependency.

Why build another reverse geocoder?

Most offline reverse geocoders rely on nearest-neighbor lookups. While fast, this approach often fails near borders because the closest location is not always the correct administrative region. This project focuses on correctness over proximity by verifying which boundary a coordinate actually falls inside.

How does it work?

A KD-Tree is used to quickly shortlist nearby administrative boundaries. For those candidates, the system performs polygon containment checks to confirm the true region. It supports both single-process execution for small workloads and multiprocessing for large batch processing.

Performance

The system processes 10,000 coordinates in under 2 seconds, with an average polygon validation time below 0.4 milliseconds per coordinate.

Who is this for?

Anyone who needs reverse geocoding, predictable costs, large-scale batch processing.

Implementation notes

This started as a toy implementation to explore boundary-aware reverse geocoding, but it turned out to be reliable enough for real production use. The dataset covers more than 210 countries with over 145,000 administrative boundaries.

Links

Source code: https://github.com/SOORAJTS2001/gazetteer

Documentation: https://gazetteer.readthedocs.io/en/stable

Feedback is welcome, especially around the approach, performance trade-offs, and edge cases.

Comments

sixtyj•18h ago
Well done.

> it returns the correct administrative region such as country, state, or district

Do you have any plans to add some street level geocoding?

I know that database would really heavy… but as there could be a huge dataset with buildings - Global Building Atlas…

gipsyjaeger•17h ago
Hi, For the given location, the library would return it's corresponding ADM2/ADM3, ADM1, ADM0. Which are essentially county/city, state and country

As of now, I am planning to add more meta data to the location like pincode, population etc

Thanks!

Tell HN: HN was down

595•uyzstvqs•3d ago•327 comments

Ask HN: Those making $500/month on side projects in 2025 – Show and tell

449•cvbox•3d ago•521 comments

Ask HN: What are your predictions for 2026?

101•mfrw•4d ago•187 comments

AI Code assistants has made completing side projects so easy

5•akmittal•9h ago•7 comments

LLM Benchmark: Frontier models now statistically indistinguishable

3•js4ever•10h ago•4 comments

Ask HN: Who here is not working on web apps/server code?

82•ex-aws-dude•2d ago•92 comments

Cloudflare has been broken for 15 hours

10•Canada•19h ago•12 comments

Ask HN: Does anyone understand how Hacker News works?

162•jannesblobel•3d ago•226 comments

Ask HN: Is GitHub becoming more and more unstable?

5•pavish•22h ago•1 comments

The offline geocoder we wanted

7•gipsyjaeger•19h ago•2 comments

Ask HN: Is building a calm, non-gamified learning app a mistake?

87•hussein-khalil•5d ago•122 comments

FWS – pip-installable embedded process supervisor with PTY/pipe/dtach back ends

4•mrsurge•2d ago•0 comments

Ask HN: How are you LLM-coding in an established code base?

69•adam_gyroscope•4d ago•66 comments

Ask HN: How do you deal with large, hard-to-read Excel formulas?

8•jack_ruru•1d ago•10 comments

Ask HN: Is Stack Overflow Dead?

12•raphar•1d ago•17 comments

Ask HN: What would you call a package whose purpose is to import data?

7•ctc24•1d ago•9 comments

Ask HN: Do you allow vibecoded submissions in your open-source projects?

3•sneas•1d ago•10 comments

Ask HN: Should I start a software foundation (goal: help emergency services)?

12•strgcmc•3d ago•0 comments

Ask HN: If you had to get a non-tech masters degree, what would you go for?

3•highwayman47•2d ago•6 comments

Ask HN: If one day AI brain chips become a thing, would you get it?

6•keepamovin•1d ago•24 comments

Ask HN: How do teams remember why infrastructure decisions were made?

6•curious_sre•2d ago•10 comments

Ask HN: Is RSS Still Alive?

10•militanz•2d ago•12 comments

Ask HN: What is the most complex software you've built single handedly?

8•chistev•15h ago•2 comments

Ask HN: Etiquette giving feedback on mostly AI-generated PRs from co-workers

4•chfritz•2d ago•6 comments

Ask HN: Is anyone using LLM based document processing in production?

7•asdev•2d ago•8 comments

Is analytics a necessary evil rather than a real value driver?

6•tiazm•2d ago•7 comments

Ask HN: How to fight back against Lovable, Replit, etc. in enterprise products

3•bears123•2d ago•3 comments

GitHub Actions Degraded

3•1qaboutecs•2d ago•0 comments

Memory Safety in C# vs. Rust

15•northlondoner•4d ago•12 comments

Ask HN: Should I Open Source Every Product I Build as an Indie Developer?

7•tomfox2•2d ago•14 comments