Get the latest tech news

Mapping latitude and longitude to country, state, or city


I made a library that takes GPS coordinates and gives you the state.

At the startup I worked at, we paid several thousands of dollars per year for the Google Maps API to do a reverse lookup (that decision was made long before I joined). It is a single-file JavaScript library with no dependencies that can run client-side to determine which state a given latitude and longitude point falls in. In these rare cases, you could fall back to a different method, such as distance checking centroid points or adding an episilon to all state borders.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of State

State

Photo of city

city

Photo of country

country

Related news:

News photo

Epic Games reveals The State of Unreal for 2025

News photo

Sony rivals Nintendo Switch 2 launch with State of Play featuring 'must-have' PS5 games

News photo

How to watch Sony's State of Play at Summer Game Fest