Skip to content

PB-2246: deploy the new 3D label dataset - #1587

Closed
rotwurstesser wants to merge 35 commits into
developfrom
fix-PB-2246-3d-swissnames-labels
Closed

PB-2246: deploy the new 3D label dataset#1587
rotwurstesser wants to merge 35 commits into
developfrom
fix-PB-2246-3d-swissnames-labels

Conversation

@rotwurstesser

@rotwurstesser rotwurstesser commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • route the Swissnames 3D layer to a dedicated MBTiles/PBF renderer while keeping other Cesium vector layers unchanged
  • load altitude/zoom-specific label tiles, sample terrain positions, and render terrain-occluded labels through a CustomDataSource
  • limit regular-label display distance and improve lake/peak contrast against terrain

Side effects and review focus

  • this replaces only the ch.swisstopo.swissnames3d.3d rendering path
  • the renderer uses the existing environment-specific 3D base URL; no host or token is hard-coded
  • missing label tiles are ignored without stopping the Cesium renderer
  • screen-space collision/decluttering is intentionally not included

Before Merge:

  • Remove old label implementation
  • Verify all data mutations work on data provider side
  • Verify we dont want to use unstable cesium MTV Provider

Test link

Raphael Antonietti added 5 commits July 8, 2026 17:32
Add direct MVT decoder dependencies and pure Swissnames helper coverage for config URLs, tile math, layer normalization, and feature property extraction.
Issue: the new Swissnames 3D label dataset is delivered as MBTiles/PBF
vector tiles, which the existing Cesium 3D Tiles label path cannot render,
and labels must stay terrain-occluded instead of fixed in the foreground.

Solution: add a dedicated Swissnames renderer: a thin layer component, a
lifecycle composable that owns a CustomDataSource and refreshes labels on
camera.moveEnd (mutating labels mid-render crashed Cesium), and focused
helpers for camera/tile selection, terrain-sampled label entities, and
tile fetch/cache/failure state.
Issue: the Swissnames labels layer still renders through the generic
Cesium 3D Tiles vector path, which cannot consume the new dataset.

Solution: route only CESIUM_LABELS_LAYER_ID to CesiumSwissnamesLabelsLayer
and keep every other vector layer on CesiumVectorLayer, so reverting this
single commit restores the old label path.
Issue: oblique 3D views stack every loaded town and village name into a
dense band along the horizon, and the translucent label boxes wash out
against bright terrain.

Solution: cut each label at its layer's altitude band, capped at 25 km
for regular layers so only landmark tiers with country/canton-sized
bands render toward the horizon; darken the label background and
brighten lake/peak text for contrast, and cover the cutoff rules with
unit tests.
Issue: lake and peak labels remain difficult to read against bright terrain.

Solution: darken the translucent label background and brighten lake and peak colors to exceed WCAG contrast thresholds.
@github-actions github-actions Bot added the bug Something isn't working as expected label Jul 13, 2026
@cypress

cypress Bot commented Jul 13, 2026

Copy link
Copy Markdown

web-mapviewer    Run #6592

Run Properties:  status check passed Passed #6592  •  git commit 66e8b1b164: PB-2246: inline Swissnames feature decoding
Project web-mapviewer
Branch Review fix-PB-2246-3d-swissnames-labels
Run status status check passed Passed #6592
Run duration 05m 16s
Commit git commit 66e8b1b164: PB-2246: inline Swissnames feature decoding
Committer Raphael Antonietti
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 19
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 222
View all changes introduced in this branch ↗︎

Raphael Antonietti added 23 commits July 14, 2026 17:35
Keep manifest transport and publication-specific defaults out of the Cesium renderer.
Keep the renderer focused on Cesium lifecycle and tile visibility while the API adapter owns the temporary manifest, PBF transport, decoding, and producer-field normalization. Cancel obsolete tile requests without blacklisting later reloads.
Preserve coverage for the adapter's manifest HTTP error contract after moving tile transport and decoding behind the fetch boundary.
Remove aborted tile requests from the active concurrency count immediately so newly visible tiles can start without waiting for the capacity retry timer.
Transient tile failures were permanently suppressed after the first attempt.

Normalize known sparse 403 responses as empty and retry other failures once before suppressing them.
Remove cached Cesium entities when their tiles leave the visible area so camera movement does not accumulate hidden labels.
Avoid repeating requests for sparse tiles that returned HTTP 403 during the mounted adapter lifetime.
Swissnames now uses its dedicated MVT renderer, so the old 3D Tiles style branch can no longer run. Remove the option and obsolete style module.
Use the removal callback returned by Cesium's camera event instead of tracking listener registration separately.
Keep canceled requests in the pending map until their owning promise settles so non-abortable terrain sampling cannot overlap a replacement request.
The renderer loads the publication before requesting label tiles. Remove the impossible call-order guard and its dedicated test.
Use Set.delete to combine retry-state lookup and removal while preserving abort, retry, suppression, and finally cleanup behavior.
Keep the measured visible-tile safety bound fixed in production and remove the test-only override parameter.
@rotwurstesser

Copy link
Copy Markdown
Contributor Author

Superseded by #1589, which uses the selected standard 3D Tiles solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working as expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant