L13 Planung: Geocoding der Objekte über OpenStreetMap Nominatim

Provider-Interface (nominatim|none), strukturierte Suche mit User-Agent und Accept-Language, Drosselung 1/s je Prozess, Job geocode-site (Worker: Concurrency 1 + Limiter), Cache am Objekt, manuelle Koordinaten bleiben, Auslöser Anlage/Adressänderung/Import-Bestätigung nur per Queue, Backfill-Skript, Env-Beispiele. Tests mit Fake-Provider, Nominatim nie aufgerufen.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-15 10:13:26 +02:00
co-authored by Claude Opus 5
parent 604f2bfdc5
commit 213bcca3a1
14 changed files with 600 additions and 2 deletions
@@ -0,0 +1,12 @@
import { geocodeSite } from "@/server/services/geo/geocode-site";
import type { JobPayload } from "../queues";
/**
* Queue "geocode-site" (L13 Planung): address → coordinates for one site, cached on the row.
* The worker runs this queue with concurrency 1 + BullMQ limiter 1/s; the Nominatim provider
* additionally throttles process-wide. `failed` is rethrown so BullMQ retries with backoff.
*/
export async function process(payload: JobPayload): Promise<void> {
const outcome = await geocodeSite(payload.tenantId, payload.entityId);
if (outcome === "failed") throw new Error("geocoding failed (retry scheduled)");
}