From 1943a1d13c19027e55bd24e316fb80014330eee7 Mon Sep 17 00:00:00 2001 From: Till JS Date: Sat, 11 Apr 2026 04:58:55 +0200 Subject: [PATCH] fix(geocoding): Pelias config for DACH-only import + single-country filter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After importing 22M OSM objects for the DACH extract: - Disable adminLookup (no WOF data needed for address search) - Configure leveldb path inside the data volume - Specify planet-latest.osm.pbf as the import filename - Convert libpostal service config from string to object form - Drop boundary.country default — Pelias only accepts a single country value, and our index only contains DACH data anyway Verified forward + reverse geocoding work end-to-end for Konstanz test queries via the mana-geocoding wrapper on port 3018. Known limitation: OSM category/type (amenity:restaurant etc.) is not yet populated in Pelias responses — will require whitelisting those tags in the importer config and re-running the import. Co-Authored-By: Claude Opus 4.6 (1M context) --- services/mana-geocoding/pelias/pelias.json | 34 +++++++++++++++---- services/mana-geocoding/src/routes/geocode.ts | 3 +- 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/services/mana-geocoding/pelias/pelias.json b/services/mana-geocoding/pelias/pelias.json index e760fcf40..0e8ee3ea3 100644 --- a/services/mana-geocoding/pelias/pelias.json +++ b/services/mana-geocoding/pelias/pelias.json @@ -10,13 +10,25 @@ }, "api": { "services": { - "libpostal": "http://libpostal:4400" + "libpostal": { + "url": "http://libpostal:4400" + }, + "placeholder": { + "url": "http://placeholder:4100" + }, + "pip": { + "url": "http://pip:4200" + }, + "interpolation": { + "url": "http://interpolation:4300" + } }, - "defaultParameters": { - "boundary.country": ["DEU", "AUT", "CHE"] - } + "defaultParameters": {} }, "imports": { + "adminLookup": { + "enabled": false + }, "openstreetmap": { "download": [ { @@ -24,9 +36,19 @@ } ], "datapath": "/data/openstreetmap", - "leveldbpath": "/tmp/leveldb", + "leveldbpath": "/data/leveldb", "importVenues": true, - "importAddresses": true + "importAddresses": true, + "adminLookup": false, + "useAdminHierarchyLabels": false, + "leveldb": { + "cacheSize": 256 + }, + "import": [ + { + "filename": "planet-latest.osm.pbf" + } + ] }, "polylines": { "datapath": "/data/polylines", diff --git a/services/mana-geocoding/src/routes/geocode.ts b/services/mana-geocoding/src/routes/geocode.ts index 56dd13d17..6a5ff4ca2 100644 --- a/services/mana-geocoding/src/routes/geocode.ts +++ b/services/mana-geocoding/src/routes/geocode.ts @@ -65,11 +65,12 @@ export function createGeocodeRoutes(config: Config) { return c.json({ results: cached, cached: true }); } + // Note: we don't set boundary.country — the Pelias index only + // contains DACH data, so everything is implicitly DE/AT/CH. const params = new URLSearchParams({ text: q.trim(), size: String(limit), lang, - 'boundary.country': 'DEU,AUT,CHE', }); // Bias results towards a focus point (user's current location)