fix: address review on Kartverket ground heights

- Send 20 points per request, not 50: above ~20 Kartverket answers the
  extra points from contour lines (hoydekurver) or not at all. At 20,
  nearly every camera resolves from dtm1, so the null-retry pass is gone.
  Eight requests in flight keep a cold lookup ~6 s.
- Cache misses: positions with no height are not asked again for 6 h.
- Transport failures: the first 429, 5xx or network error stops the
  lookup with no retries, and no lookup starts until the backoff ends
  (Retry-After when sent, else 10 min; bounded to 1 min-1 h).
- Budget the 12 s wait from the start of the loader, catalog fetch
  included.
- Record answers only for the points each request asked about.
- Send the CCTV User-Agent; link CC BY 4.0 in the credit.
- Docs: bridge cameras sit at the water surface, below the deck.
- Tests: batching, 8-in-flight cap, request count on failure, the shared
  deadline, Retry-After bounds, null TTL, backoff, the -20 m bound and
  each water marker on its own.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Trygve HemminghyttandClaude Opus 5.5 committed 2026-10-06 19:21:27 +02:00
1 parent c43f58dc3f
commit 34d53edc91
6 files changed
+407 -201

No files matched your search

+10 -5
View File
@@ -6,11 +6,16 @@
keyless point-height API (CC BY 4.0) instead of one flat 150 m prior, so
mountain-pass cameras no longer sit hundreds of metres below the terrain
where neither the point-height prior nor the ground snap resolves. About
840 of ~845 cameras get a height; the rest keep the old prior. Bridge and
quay cameras over water use the sea surface, not the sea-floor depth the
API returns there. A catalog load waits at most 12 s for heights, and a
lookup still running then fills a cache the next refresh applies.
`CCTV_VEGVESEN_HEIGHTS=0` turns the lookup off. Follow-up to #929.
850 of ~855 cameras get a height; the rest keep the old prior. Requests
carry 20 points, the most the API answers from its 1 m terrain model, eight
at a time (~6 s cold). Cameras over water use the water surface rather than
the sea-floor depth the API returns there; for bridge cameras that is still
below the deck. Heights are cached for good and misses for 6 h, so a
refresh only asks about new or moved cameras. After a 429, a 5xx or a
network failure the lookup stops and backs off (Retry-After, else 10 min).
The lane waits at most 12 s from its start; a slower lookup fills the cache
for the next refresh. `CCTV_VEGVESEN_HEIGHTS=0` turns it off. Follow-up to
#929.
- Add Norway's road cameras from Statens vegvesen as a CCTV pack. The camera
list is one keyless GeoJSON request to the agency's OGC API view of its