Skip to content

Chart prior importer: contour depth-below-surface → ellipsoidal Chart tiles (A2 of unh_marine_autonomy#163) #44

Description

@rolker

A2 of rolker/unh_marine_autonomy#163 (the second of two PRs). A1 — the core
SourceLayer::Chart (read-only prior) — is merged
(rolker/unh_marine_autonomy#165). This issue is the importer that converts
the existing contour prior into ellipsoidal Chart tiles the store can load, and
closes rolker/unh_marine_autonomy#163 when merged.

Why here

The store core must stay datum-agnostic (it's in core_ws). The conversion
belongs in the importer, which lives above platforms_wscube_bathymetry
(sensors_ws) can link both marine_bathymetry_store (core) and
mru_transform's datum_config (platforms). Keeps ADR-0002 §D7 (convert at
import) and the layer rules both satisfied.

What to build

  1. Chart-import path. Read the raw contour tiles
    (~/data/bathymetry/massabesic/store/chart/<date>/, 142 level-11 GeoTIFFs;
    band 1 = depth below lake surface, negative-down, metres; NH GRANIT 5-ft
    contours; band 2 uncertainty const 3.0; band 3 timestamp). For each cell,
    convert to WGS84 ellipsoidal height:

    ellipsoidal = chart_datum_z + depth_below_surface
    

    sourcing chart_datum_z per tile from
    mru_transform::resolve_datum(lat, lon, entries, /*vdatum=*/nullopt). Write
    the result into a marine_bathymetry_store store opened chart_writable=true
    (the A1 API), then save() it to the store's chart/ layer.

  2. Datum entry. Add a massabesic polygon DatumEntry
    (chart_datum_z: 52.3) to the datum config chart_datum_node loads — the
    single source of truth for the lake-surface ellipsoidal height. (52.3 m =
    estimated WGS84 ellipsoidal water-surface height; same value the sim uses.)

Verify

  • A −13.716 m (45 ft) contour cell imports to 38.58 m ellipsoidal
    (52.3 − 13.716); runtime clearance z(map_tide) − seafloor = 52.3 − 38.58 = 13.72 m = water depth.
  • All 142 tiles covered; re-import is idempotent (content-hash unchanged).
  • The produced store loads into a default (read-only-Chart) store and a
    best-source query returns the prior where no Draft/Processed exists.

Depends on / notes

Part of rolker/unh_marine_autonomy#163


Authored-By: Claude Code Agent
Model: Claude Opus 4.8 (1M context)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions