From 24df25f4d1c2cb9ad14cb8d568d1ce5322fde100 Mon Sep 17 00:00:00 2001 From: giswqs Date: Wed, 11 Nov 2026 22:13:26 -0500 Subject: [PATCH] fix(map): only Winkel Tripel reads +lat_1, as the reader does Projector::new checked +lat_1 for every world projection, so it refused a Natural Earth or Eckert IV definition the reader accepts. No preset or code gives one today. --- crates/map/src/projection.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/map/src/projection.rs b/crates/map/src/projection.rs index fb42ee49f9..03f68f43e5 100644 --- a/crates/map/src/projection.rs +++ b/crates/map/src/projection.rs @@ -620,14 +620,15 @@ impl Projector { .unwrap_or(rustgis_geom::MERCATOR_R); // Winkel Tripel's standard parallel as the definition gives it (the preset gives // Winkel's own), else 0, as PROJ and RustGIS's readers take it, so the map draws a - // definition where its data is read. + // definition where its data is read. The other projections have no standard parallel + // and ignore one, as the reader and PROJ do. let lat1 = match def.split_whitespace().find_map(|t| t.strip_prefix("+lat_1=")) { - Some(v) => v + Some(v) if kind == crate::world::Kind::WinkelTripel => v .parse::() .ok() .filter(|v| v.is_finite() && v.abs() < 90.0) .ok_or_else(|| format!("{code}: +lat_1={v} isn't a latitude short of a pole"))?, - None => 0.0, + _ => 0.0, }; let engine = Engine::World(crate::world::World { lat1, ..crate::world::World::new(kind, lon0, radius) }); return Ok(Projector { engine, to_meter: 1.0, domain, lon0, edge: std::sync::OnceLock::new() });