Ghoton
Go reimplementation of photon (v1.1.0), an open-source geocoder for OpenStreetMap data. Uses bluge for indexing.
Quick Start
go build && ./ghoton serve
Commands
ghoton serve [options] Start the API server
ghoton import [options] Import data from JSON dump
Serve Options
| Flag |
Default |
Description |
-data-dir |
./data |
Data directory for bluge index |
-listen |
localhost:2322 |
Listen address |
-languages |
en,de,fr,es,it |
Supported languages |
-default-lang |
en |
Default language |
-max-results |
50 |
Maximum results per query |
Import Options
| Flag |
Description |
-data-dir |
Data directory for bluge index (required) |
-file |
Input JSON dump file (use - for stdin) |
API Endpoints
/api - Search
Forward geocoding with optional location bias.
Parameters:
| Param |
Description |
q |
Search query (required) |
lang |
Language code (or "default") |
limit |
Max results (default: 15) |
lat, lon |
Location for bias |
zoom |
Zoom level (0-18) |
location_bias_scale |
Bias scale (0-1) |
bbox |
Bounding box filter |
layer |
Address type filter |
osm_tag |
OSM tag filter |
include |
Include categories |
exclude |
Exclude categories |
geometry |
Include full geometry |
debug |
Return query debug info |
dedupe |
Deduplicate results |
/geojson - GeoJSON Search
Same parameters as /api, returns full GeoJSON with geometry.
/status
Returns index status:
{
"status": "Ok",
"import_date": "2026-05-02T00:00:00Z"
}
License
Apache 2.0
History
- v0.0.2 - Now with all files
- v0.0.1 - Initial Release