Skip to content

fix(scale): render features + gate SCAMIN on the true physical displa…#21

Merged
beetlebugorg merged 1 commit into
mainfrom
fix/physical-feature-scale
Jun 26, 2026
Merged

fix(scale): render features + gate SCAMIN on the true physical displa…#21
beetlebugorg merged 1 commit into
mainfrom
fix/physical-feature-scale

Conversation

@beetlebugorg

Copy link
Copy Markdown
Owner

…y scale

S-52 references everything to one calibrated physical Display Scale ([distance on glass]/[distance on earth]), with the display dimensionally calibrated (S-52 Annex C). The renderer instead used three different fixed pixel sizes — 0.35278 mm (typographic point) for symbol/line/text sizing, 0.28 mm (OGC web tile pixel) for SCAMIN gating, and 0.2645 mm (CSS pixel) for the scale readout — none of which is the screen's real pitch. On a dense display this drew every symbol/line/label ~25-30% too small ("like zoomed out") and made SCAMIN features linger past their stated scale (a 1:17999 feature survived to ~1:20000-22000).

Collapse the two render-side constants onto the calibrated pxPitch the readout already uses:

  • Feature sizing: multiply icon-size/line-width/text-size/halo (and the pattern raster ratio) by 0.35278/pxPitch in the style builder, so symbols render at their exact S-52 physical mm. S-52 §3.1.5: symbol size is fixed and held constant across zoom.
  • SCAMIN: scaminDisplayZoom now returns zoomForScalePhysical(scamin, lat, pxPitch), so a 1:N feature appears exactly when the screen reads 1:N (S-57 B.1 §2.2.7). pxPitch is threaded through buildChartLayers and the in-place latitude re-gate via a getPxPitch callback on ChartSources.

The element rebuilds the style on setPxPitch; the shell pushes the calibration at boot and on change. The baker's OGC-pixel tile floor is left as-is: real screens are finer than 0.28 mm, so the client always gates at or above the baked floor (the safe direction).

…y scale

S-52 references everything to one calibrated physical Display Scale
([distance on glass]/[distance on earth]), with the display dimensionally
calibrated (S-52 Annex C). The renderer instead used three different fixed
pixel sizes — 0.35278 mm (typographic point) for symbol/line/text sizing,
0.28 mm (OGC web tile pixel) for SCAMIN gating, and 0.2645 mm (CSS pixel)
for the scale readout — none of which is the screen's real pitch. On a dense
display this drew every symbol/line/label ~25-30% too small ("like zoomed
out") and made SCAMIN features linger past their stated scale (a 1:17999
feature survived to ~1:20000-22000).

Collapse the two render-side constants onto the calibrated pxPitch the
readout already uses:

- Feature sizing: multiply icon-size/line-width/text-size/halo (and the
  pattern raster ratio) by 0.35278/pxPitch in the style builder, so symbols
  render at their exact S-52 physical mm. S-52 §3.1.5: symbol size is fixed
  and held constant across zoom.
- SCAMIN: scaminDisplayZoom now returns zoomForScalePhysical(scamin, lat,
  pxPitch), so a 1:N feature appears exactly when the screen reads 1:N
  (S-57 B.1 §2.2.7). pxPitch is threaded through buildChartLayers and the
  in-place latitude re-gate via a getPxPitch callback on ChartSources.

The element rebuilds the style on setPxPitch; the shell pushes the
calibration at boot and on change. The baker's OGC-pixel tile floor is left
as-is: real screens are finer than 0.28 mm, so the client always gates at or
above the baked floor (the safe direction).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@beetlebugorg beetlebugorg merged commit 9ffe476 into main Jun 26, 2026
4 checks passed
@beetlebugorg beetlebugorg deleted the fix/physical-feature-scale branch June 26, 2026 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant