symerio / pgeocode

Postal code geocoding and distance calculation
https://pgeocode.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
231 stars 57 forks source link

Inverse postal code geocoding #7

Open rth opened 5 years ago

rth commented 5 years ago

It should be fairly straightforward to implement inverse geo-coding, i.e. find the closest city/region/country for given coordinates.

This would require downloading all the datasets however.

Ideally, the nearest neighbor lookup could be done efficiently with a KD-tree structure (e.g. in scipy). Though scipy is a fairly heavy dependency so maybe this could be an optional feature if scipy is installed.

rth commented 5 years ago

Ideally, the nearest neighbor lookup could be done efficiently with a KD-tree structure

Actually, computing brute force nearest neighbor search could be a start: memory and performance optimizations with KDTree could be added later.