From 890f1dfc482be6e93d86c23feda1ec95bbd1cbe4 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 18 Aug 2026 01:33:21 +0000 Subject: [PATCH] cockpit-server: retire simplify_cells as a production symbol MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit query_tile_geometry (the JSON wire) does its own tile_to_lonlat projection over query_tile_shapes's output, and the binary wire (encode_tile_bin) projects to tile-relative pixels instead — neither calls simplify_cells. It has had no production caller since that split landed, only three tests, and its doc comment ("the JSON wire's view") no longer describes anything real. Move the wrapper into the test module as a private helper with a corrected comment, so a reader doesn't mistake it for wired-in production code. Pure relocation: same signature, same body, same call sites (all three tests already refer to it by name and resolve unchanged via mod tests's `use super::*`). Could not verify with cargo check/test: cargo check -p cockpit-server --bin q2-cockpit currently fails independent of this change (E0599, lance-graph-ogar references a ConceptDomain::Weather variant that does not exist in the current OGAR checkout — confirmed pre-existing via git stash). Filed as a separate blocker; reviewed this diff by hand (module-scope resolution, no other call sites) since compiling it end-to-end isn't possible right now. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01NMeiLmtDKhomJNSo2ecbJw --- crates/cockpit-server/src/osm_features.rs | 27 ++++++++++++++--------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/crates/cockpit-server/src/osm_features.rs b/crates/cockpit-server/src/osm_features.rs index a046b0ac8..34cbcd6f0 100644 --- a/crates/cockpit-server/src/osm_features.rs +++ b/crates/cockpit-server/src/osm_features.rs @@ -1179,17 +1179,6 @@ fn simplify_cells_raw( out } -/// The lon/lat projection of [`simplify_cells_raw`] — the JSON wire's view. -fn simplify_cells(chain: &[osm_soa_bake::tms::TileXy], z: u32) -> Vec<[f64; 2]> { - simplify_cells_raw(chain, z) - .into_iter() - .map(|c| { - let (lon, lat) = osm_soa_bake::tms::tile_to_lonlat(c.x, c.y_xyz); - [lon, lat] - }) - .collect() -} - /// Geometry is far heavier per row than a dot, so it gets its own ceiling /// rather than reusing [`row_budget`]. Same zoom split and same reasoning as /// there: decimating an overview is a legitimate LOD choice, decimating a city @@ -1998,6 +1987,22 @@ mod tests { .collect() } + /// Test-only convenience: the lon/lat projection of [`simplify_cells_raw`], + /// so the assertions below can compare degrees directly instead of + /// re-deriving `tile_to_lonlat` at every call site. Production code + /// projects `simplify_cells_raw`'s output inline (`query_tile_geometry` + /// for JSON, `encode_tile_bin` for the binary wire) — this wrapper has no + /// production caller of its own. + fn simplify_cells(chain: &[osm_soa_bake::tms::TileXy], z: u32) -> Vec<[f64; 2]> { + simplify_cells_raw(chain, z) + .into_iter() + .map(|c| { + let (lon, lat) = osm_soa_bake::tms::tile_to_lonlat(c.x, c.y_xyz); + [lon, lat] + }) + .collect() + } + #[test] fn class_for_tags_applies_precedence_not_first_match() { // Each rule fires on its own…