[PLAN] Chart prior importer: contour → ellipsoidal Chart tiles (A2 of unh_marine_autonomy#163)#45
Draft
rolker wants to merge 2 commits into
Draft
[PLAN] Chart prior importer: contour → ellipsoidal Chart tiles (A2 of unh_marine_autonomy#163)#45rolker wants to merge 2 commits into
rolker wants to merge 2 commits into
Conversation
Chart prior importer: new import_chart_prior exe (cube_bathymetry) reads raw contour tiles via loadTile, converts depth-below-surface to ellipsoidal via resolve_datum (massabesic chart_datum_z=52.3), writes the read-only Chart layer via A1's chart_writable store + save(). + sibling mru_transform datum config.
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.
Closes #44
Closes rolker/unh_marine_autonomy#163
Plan: Chart prior importer — contour depth-below-surface → ellipsoidal Chart tiles (A2)
Issue
#44 (A2 of, and closes, rolker/unh_marine_autonomy#163)
Context
A1 (merged) added
SourceLayer::Chart+ thechart_writableflag tomarine_bathymetry_store. A2 is the importer that turns the existing raw contourprior into ellipsoidal Chart tiles the store can load.
cube_bathymetry(sensors_ws) is the right home: it can link both
marine_bathymetry_store(core_ws) and
mru_transform'sdatum_config(platforms_ws) — keeping the storecore datum-agnostic (ADR-0002 §D7, convert at import). The package already uses
GDAL + GGGS (
bag_to_geotiff.cppis the model) but does not yet depend on thestore or mru_transform.
Raw input (
~/data/bathymetry/massabesic/store/chart/<date>/, 142 level-11GeoTIFFs): band1 = depth below lake surface, negative-down, m; band2 = const
3.0 uncertainty; band3 = timestamp. Conversion:
ellipsoidal = chart_datum_z + depth_below_surface, withchart_datum_zfromresolve_datum(lat,lon,entries, nullopt)(= 52.3 m inside themassabesicpolygon).Approach (single PR, cube_bathymetry; + one sibling mru_transform change — see OQ1)
import_chart_prior(src/import_chart_prior.cpp), CLI:--contour-dir <raw tiles> --store <out dir> --datum-config <yaml> [--level 11].src/chart_import.{hpp,cpp}or in-lib, ROS-free): givena
BathymetryTile(raw, depth-below-surface) + a resolvedchart_datum_z,produce the ellipsoidal tile — so the arithmetic is unit-testable without GDAL.
load_datum_config(path); for each*.tifin the contour dirBathymetryTile raw = loadTile(path, level)(reads by path — epoch subdir isfine); per data cell compute lat/lon from its
CellIndex,resolve_datum(...)→
chart_datum_z(warn+skip cells outside any polygon), set{chart_datum_z + raw.depth, raw.uncertainty, raw.timestamp}into aBathymetryStore(level, /*chart_writable=*/true)viaset(Chart, …); thensave(store, out_dir). Resolve the datum once per tile (constant within themassabesicpolygon) — not per cell.marine_bathymetry_store+mru_transformtopackage.xml/CMakeLists.txt(find_package + link); newadd_executable.massabesicdatum entry (chart_datum_z: 52.3, polygon ring around thelake) — see OQ1 for where it lands.
Files to Change
cube_bathymetry/src/import_chart_prior.cppcube_bathymetry/src/chart_import.{hpp,cpp}cube_bathymetry/CMakeLists.txt/package.xmlmarine_bathymetry_store,mru_transform; new execube_bathymetry/test/test_chart_import.cppmru_transform/config/datum_polygons.massabesic.yamlmassabesicentry (OQ1)Principles Self-Check
loadTile/save(store) +resolve_datum(mru_transform); no new tile or datum code.ADR Compliance
Consequences
massabesicdatum entrychart_datum_pathshould point at the same file (single source)Open Questions
datum_polygons.massabesic.yamllive + who ships it? Recommendmru_transform/config/(whereresolve_datum+ the example live, and where theruntime
chart_datum_nodedatum_config_pathwould point — single source oftruth) as a small sibling PR. The importer just takes
--datum-config <path>.for the
ring; a generous bounding polygon around 42.99 N / -71.39 W suffices fora constant offset. Source the vertices before implementing the config.
Estimated Scope
One cube_bathymetry PR (importer + tests) + one small mru_transform PR (datum
config). Depends on A1 (merged); independent of the open #148 Phase-2 importer.