mamaps: revert unnamed water zoom change (real issue is DEM over ocean)
- Commit
bc7e4d45b8387adc549bd9aa1d1ffcd348f17fd4- Author
- vayun-mathur <[email protected]>
- When
- 2026-09-19 21:47 UTC (2 months ago)
- Parents
7fffe58
Diff
scripts/maps/mamaps_build/src/schema/landtype.rs
diff --git a/scripts/maps/mamaps_build/src/schema/landtype.rs b/scripts/maps/mamaps_build/src/schema/landtype.rsindex 475e708cc7..53d50ad60d 100644--- a/scripts/maps/mamaps_build/src/schema/landtype.rs+++ b/scripts/maps/mamaps_build/src/schema/landtype.rs@@ -138,7 +138,7 @@ fn classify_water(tags: &(impl TagSource + ?Sized), is_way: bool) -> Option<Clas "fjord" => Some(Class::area(LAYER_LANDTYPE, kind("fjord"), 6)), "reef" => Some(Class::area(LAYER_LANDTYPE, kind("reef"), 10)), // The generic one, and by far the most common. A lake if `water` says so.- "water" => Some(water_class(tags)),+ "water" => Some(Class::area(LAYER_LANDTYPE, water_kind(tags), water_min_zoom(tags))), _ => None, }; if class.is_some() {@@ -196,16 +196,11 @@ fn water_kind(tags: &(impl TagSource + ?Sized)) -> u16 { /// A named lake is a landmark and an unnamed pond is not, and a name is the only signal in the tags /// that separates them. This is the one place the classifier reads `name` at all โ for a *decision*, /// not to carry it.-///-/// Both ride at the same zoom as the other landtypes (the park tier, z8): the area floor, not the-/// zoom gate, is what keeps farm ponds out of shallow tiles โ a pond smaller than a couple of-/// pixels is a speck at z8, and `with_area` culls it there instead of hiding every unnamed lake-/// until z12.-fn water_class(tags: &(impl TagSource + ?Sized)) -> Class {+fn water_min_zoom(tags: &(impl TagSource + ?Sized)) -> u8 { if tags.has("name") {- Class::area(LAYER_LANDTYPE, water_kind(tags), 6)+ 6 } else {- with_area(water_kind(tags), 8, 2.0)+ 12 } } @@ -551,16 +546,14 @@ mod tests { } } - /// The judgement that matters: a named lake is a landmark from z6, an unnamed pond- /// rides at the park tier (z8) with a 2px floor โ the floor, not the zoom gate, is- /// what keeps farm ponds out of shallow tiles.+ /// The judgement that matters: a named lake is a landmark from z6, an unnamed pond is street+ /// detail. Without this a z6 tile carries every farm pond in the state. #[test] fn a_named_water_body_is_carried_far_shallower_than_an_unnamed_one() { let named = classify_tags(&[("natural", "water"), ("name", "Lake Tahoe")], true).expect("named"); let pond = classify_tags(&[("natural", "water")], true).expect("unnamed"); assert_eq!(named.min_zoom, 6);- assert_eq!(pond.min_zoom, 8);- assert_eq!(pond.min_area_px, 2.0);+ assert_eq!(pond.min_zoom, 12); assert!(named.min_zoom < pond.min_zoom); }