Skip to content

Preserve camera direction range spans - #1

Open
anthony-maio wants to merge 1 commit into
FoggedLens:mainfrom
anthony-maio:fix/issue-145-direction-spans
Open

Preserve camera direction range spans#1
anthony-maio wants to merge 1 commit into
FoggedLens:mainfrom
anthony-maio:fix/issue-145-direction-spans

Conversation

@anthony-maio

@anthony-maio anthony-maio commented Aug 20, 2026

Copy link
Copy Markdown

Summary

Preserves the width of OSM direction ranges so downstream camera maps can render the documented field of view instead of reducing every range to its midpoint.

Root Cause

data/cameras/lib.mjs parsed ranges such as 239-284 into a midpoint but discarded the original 45-degree span. That made the GeoJSON and generated PMTiles indistinguishable from a single-bearing camera.

Execution Flow

flowchart LR
    A[OSM direction range] --> B[Camera parser]
    B --> C[Hourly GeoJSON]
    C --> D[Main and filtered PMTiles]
    D --> E[Maps renderer]
Loading

Fix

  • Publish optional directionSpan for the first retained direction token.
  • Publish index-aligned directionSpans for plural directions when at least one token is a range.
  • Preserve null placeholders for non-range entries without inventing all-null metadata.
  • Keep the existing direction and directions fields unchanged for compatibility.
  • Bump the camera tile build token to v9-direction-spans so archives rebuild with the additive properties.

Part of FoggedLens/deflock#145. Paired with the consumer PR: FoggedLens/deflockhopper_maps#14

Test plan

  • node --test data/cameras/*.test.mjs tiles/cameras/*.test.mjs -- 109 tests pass, including atomic rejection of non-finite tokens and derived range overflow.
  • shellcheck tiles/cameras/build.sh tiles/cameras/verify.sh tiles/cameras/verify-filter.sh.
  • Main and filtered PMTiles built from the three-camera fixture and retained singular and aligned plural span properties at z12.
  • Sabotage check: removing singular span publication caused three focused regressions; restoring it returned the focused suite to green.
  • git diff --check.

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