Home
Offline geocoding from a single compact SQLite file built from OpenStreetMap data. No server, no API keys.
- Reverse geocoding: lat/lon → address (house number, street, suburb, city, state, country)
- Search: address text → lat/lon, with type-ahead, house numbers and address interpolation
Search any address in Berlin. It runs entirely in your browser from one SQLite file,
which downloads when you start. Source: examples/berlin-map.
Try the full example app
The example app in the repository goes further: it reads the database with HTTP range requests, switches between datasets and retrieval modes, and reverse geocodes wherever you click. Run it yourself.
loconym has two parts that share one file format:
| What it does | Install | |
|---|---|---|
Python CLI (loconym) |
Builds a database from an .osm.pbf extract |
pip install loconym |
TypeScript client (loconym) |
Queries the database in the browser, by downloading it or by reading only the pages it needs over HTTP range requests | npm install loconym |
import { Loconym } from 'loconym';
const geocoder = await Loconym.open({ url: '/data/monaco.sqlite', mode: 'fetch' });
const place = await geocoder.reverse({ lat: 43.7384, lon: 7.4246 });
console.log(place?.display_name); // "Avenue des Papalins 9, Monte-Carlo, Monaco"
Where to go next¶
-
Tutorials
New to loconym? Build your first offline geocoder end to end in about 15 minutes.
-
How-to guides
Task recipes: serve with range requests, build address autocomplete, build country-sized databases, and more.
-
Reference
The CLI, the TypeScript API, the Python API and the database format.
-
Explanation
How loconym works, range vs fetch mode, and how search matches addresses.
Early software
The format is v0 and the defaults are tuned for Germany. See Status and limitations.