trails/infrastructure/scripts/poi-selectors.sql
Ullrich Schäfer e703843b9b
poi-index: extract pipeline (BRouter host) + import job (flagship) + e2e
- poi-extract.sh: PBF download -> osmium tags-filter -> centroid NDJSON +
  manifest, published via the Caddy sidecar at vSwitch-only /poi/*
- osmium-filters.txt + poi-selectors.sql generated from map-core selectors,
  guarded by sync tests so poiCategories stays the single source of truth
- poi-import.sh: checksum verify -> classify into category rows ->
  70% guard (--bootstrap override) -> atomic rename swap; node_exporter
  textfile metric for import outcome
- systemd service+timer units for both halves (monthly, offset)
- cd-infra.yml: ship infrastructure/scripts to the flagship
- e2e: mock /api/pois instead of /api/overpass

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-12 22:48:32 +02:00

28 lines
1.3 KiB
SQL

-- GENERATED from @trails-cool/map-core poiCategories. Do not edit by hand;
-- regenerate with: npx tsx infrastructure/scripts/gen-poi-selectors-sql.ts
-- Loaded by poi-import.sh inside the import transaction to classify each
-- extracted OSM element into one row per matching category.
CREATE TEMP TABLE poi_selector (key text, value text, category text) ON COMMIT DROP;
INSERT INTO poi_selector (key, value, category) VALUES
('amenity', 'drinking_water', 'drinking_water'),
('amenity', 'water_point', 'drinking_water'),
('amenity', 'shelter', 'shelter'),
('tourism', 'wilderness_hut', 'shelter'),
('tourism', 'camp_site', 'camping'),
('tourism', 'caravan_site', 'camping'),
('amenity', 'restaurant', 'food'),
('amenity', 'cafe', 'food'),
('amenity', 'fast_food', 'food'),
('amenity', 'pub', 'food'),
('amenity', 'biergarten', 'food'),
('shop', 'supermarket', 'groceries'),
('shop', 'convenience', 'groceries'),
('shop', 'bakery', 'groceries'),
('amenity', 'bicycle_parking', 'bike_infra'),
('amenity', 'bicycle_repair_station', 'bike_infra'),
('amenity', 'bicycle_rental', 'bike_infra'),
('tourism', 'hotel', 'accommodation'),
('tourism', 'hostel', 'accommodation'),
('tourism', 'guest_house', 'accommodation'),
('tourism', 'viewpoint', 'viewpoints'),
('amenity', 'toilets', 'toilets');