fix(scale): render features + gate SCAMIN on the true physical displa…#21
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…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:
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).