feat(geocoding): auto-categorize places via Pelias taxonomy

Pelias hides the 'category' field from API responses unless the
caller filters by categories=... explicitly — a default intended for
keyword search that strips category metadata from address queries.

Patch the Pelias API's geojsonify_place_details.js so the category
array is returned on every feature (food, retail, transport, …),
mounted into the container as a read-only volume override.

Rewrite category-map.ts to map Pelias' OSM taxonomy to our 7
PlaceCategories using a priority-ordered list so a restaurant
tagged ['food','retail','nightlife'] resolves to 'food' (the most
specific), not 'shopping'.

Verified with Konstanz test queries:
  Konzil Restaurant        → food
  Bahnhof Konstanz         → transit
  Physiotherapie-Schule    → work
  MX-Park                  → leisure

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Till JS 2026-04-11 15:48:24 +02:00
parent 1293756bbf
commit e82b5c1449
5 changed files with 195 additions and 156 deletions

View file

@ -31,8 +31,8 @@ export interface GeocodingResult {
country?: string;
};
category: PlaceCategory;
osmCategory?: string;
osmType?: string;
/** Raw Pelias categories (food, retail, transport, …) */
peliasCategories?: string[];
confidence: number;
}