Skip to content

Home

loconym logo

A local geocoder with an alligator mascot!

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
loconym build monaco-latest.osm.pbf -o monaco.sqlite
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

Early software

The format is v0 and the defaults are tuned for Germany. See Status and limitations.