NOW LET US – AI RAG SaaS Studio TP.HCM
NOW LET US
Digital Product Studio
Back to news
DEV-TOOLS...1 min read

Hyper-optimized reverse geocoding API

Share
NOW LET US Article – Hyper-optimized reverse geocoding API

A fast, self-hosted reverse geocoding service built from OpenStreetMap data, offering sub-millisecond query latency through a specialized C++ builder and Rust server architecture.

A fast, self-hosted reverse geocoding service built from OpenStreetMap data. Given latitude and longitude coordinates, it returns the nearest street address including house number, street name, city, state, county, postcode, and country.

Part of the Traccar open source GPS tracking platform. Also available as a hosted service.

  • Street-level reverse geocoding from OSM data
  • Address point, street name, and address interpolation lookup
  • Administrative boundary resolution (country, state, county, city, postcode)
  • Sub-millisecond query latency with memory-mapped index files
  • Automatic HTTPS with Let's Encrypt
  • Docker support with automatic PBF download and indexing
services:
  geocoder:
    image: traccar/traccar-geocoder
    environment:
      - PBF_URLS=https://download.geofabrik.de/europe/monaco-latest.osm.pbf
    ports:
      - "3000:3000"
    volumes:
      - geocoder-data:/data
volumes:
  geocoder-data:

docker compose up

# All-in-one: download, build index, and serve
docker run -e PBF_URLS="https://download.geofabrik.de/europe-latest.osm.pbf" \
-v geocoder-data:/data -p 3000:3000 traccar/traccar-geocoder
# Build index only
docker run -e PBF_URLS="https://download.geofabrik.de/europe-latest.osm.pbf" \
-v geocoder-data:/data traccar/traccar-geocoder build
# Serve only (from pre-built index)
docker run -v geocoder-data:/data -p 3000:3000 traccar/traccar-geocoder serve
# Multiple PBF files
docker run -e PBF_URLS="https://download.geofabrik.de/europe/france-latest.osm.pbf https://download.geofabrik.de/europe/germany-latest.osm.pbf" \
-v geocoder-data:/data -p 3000:3000 traccar/traccar-geocoder
# With automatic HTTPS
docker run -e PBF_URLS="https://download.geofabrik.de/planet-latest.osm.pbf" \
-e DOMAIN=geocoder.example.com \
-v geocoder-data:/data -p 443:443 traccar/traccar-geocoder

PBF files can be downloaded from Geofabrik.

Query parameters:

lat - latitude (required) lon - longitude (required)

Response follows Nominatim format:

{
"display_name": "Avenue de la Costa 42, 98000 Monaco, Monaco",
"address": {
"house_number": "42",
"road": "Avenue de la Costa",
"city": "Monaco",
"state": "Monaco",
"county": "Monaco",
"postcode": "98000",
"country": "Monaco",
"country_code": "MC"
}
}

Fields are omitted when not available.

The project consists of two components:

Builder (C++) - Parses OSM PBF files and creates a compact binary index using S2 geometry cells for spatial lookup. Server (Rust) - Memory-maps the index files and serves queries via HTTP/HTTPS with sub-millisecond latency.

The builder produces 14 binary files including geo_cells.bin, street_ways.bin, and admin_polygons.bin. Requirements include CMake 3.16+, C++17 compiler, and Rust toolchain for manual builds.

© 2026 Now Let Us. All rights reserved.

Source: Hacker News

Advertisement
Ad slot ready: 5887729102

More in this category

EXPLORE TOPICS

Discover All Categories

Deep dive into the specific technology sectors that matter most to you.