diff --git a/crates/analysis/src/tools.rs b/crates/analysis/src/tools.rs index e9845d5a05..bb78820ebe 100644 --- a/crates/analysis/src/tools.rs +++ b/crates/analysis/src/tools.rs @@ -1906,7 +1906,7 @@ fn clip_on(inp: &dyn Inputs, p: &Json, threads: Option, cache_bytes: Opti } r.messages.extend(left.notes("Clip", &clip_ds.name)); if slivers > 0 { - r.messages.push(format!("Clip: {slivers} output feature(s) have less than one millionth of their input feature's area; they may be slivers along the clip boundary (kept unchanged)")); + r.messages.push(format!("Clip: {slivers} output feature(s) have less than one millionth of their input feature's area in the overlay plane; they may be slivers along the clip boundary (kept unchanged)")); } Ok(r) } @@ -5171,11 +5171,12 @@ fn ground_area_perimeter(g: &Geometry) -> (f64, f64) { let polar = ring.0.first().zip(ring.0.last()).is_some_and(|(a, b)| (a.x - b.x).abs() > 180.0); let orientable = !polar && ring.0.iter().all(|c| c.x.is_finite() && (-90.0..=90.0).contains(&c.y)); let polygon = geo::Polygon::new(ring, vec![]); - // Within a longitude span of 180°, the ring cannot enclose more than a hemisphere. + // Within an unwrapped longitude span of 180°, the ring cannot enclose more than a + // hemisphere. // Use signed magnitude there: a tiny overlay sliver can have opposite planar and // geodesic windings, making its unsigned area nearly the whole Earth (#1966). - let wide = polygon.bounding_rect().is_some_and(|bounds| bounds.width() > 180.0); - let (rp, ra) = if orientable && wide { + let wide = orientable && polygon.bounding_rect().is_some_and(|bounds| bounds.width() > 180.0); + let (rp, ra) = if wide { polygon.orient(Direction::Default).geodesic_perimeter_area_unsigned() } else { // Keep smaller local rings and polar caps; invalid coordinates bypass orientation. @@ -13415,7 +13416,7 @@ mod tests { r.messages, [ "Clip: 2 features kept", - "Clip: 2 output feature(s) have less than one millionth of their input feature's area; they may be slivers along the clip boundary (kept unchanged)", + "Clip: 2 output feature(s) have less than one millionth of their input feature's area in the overlay plane; they may be slivers along the clip boundary (kept unchanged)", ] ); let out = layer(r); diff --git a/crates/analysis/src/warp.rs b/crates/analysis/src/warp.rs index 635683ea14..f86d02aa9b 100644 --- a/crates/analysis/src/warp.rs +++ b/crates/analysis/src/warp.rs @@ -453,9 +453,9 @@ impl Method { /// Projects `r` onto the grid `g`, through longitude/latitude when their coordinate systems /// differ: each cell sampled at its centre, or (average, mode) taken from every pixel of `r` /// whose centre falls in it. A cell no pixel centre falls in (a grid finer than the raster) takes -/// the pixel under its centre. Cells off the raster are its no-data (else NaN, or 0 in a -/// whole-number type), or see-through for a colour image with neither alpha nor no-data, which -/// gains an alpha band for it. +/// the pixel under its centre. Cells off the raster are its no-data (else NaN, or 0 in an +/// unlabelled whole-number type). A band with class names makes outside cells NaN in every band. +/// A colour image with neither alpha nor no-data gains an alpha band for see-through cells. pub fn project(r: &Raster, g: &Grid, method: Method, name: String) -> Result { project_on(None, r, g, method, name) } diff --git a/crates/analysis/tests/parallel_serial.rs b/crates/analysis/tests/parallel_serial.rs index f9d6992132..cc65ac8b6a 100644 --- a/crates/analysis/tests/parallel_serial.rs +++ b/crates/analysis/tests/parallel_serial.rs @@ -183,6 +183,7 @@ fn outputs(s: &Scene) -> Vec<(String, Made)> { add("dissolve", tool("dissolve", json!({"input": "polygons", "field": "class", "statistics": stats}))); add("near", tool("near", json!({"input": "points", "near": "polygons"}))); add("convex hull", tool("convexHull", json!({"input": "polygons", "group": "None"}))); + add("convex hull all", tool("convexHull", json!({"input": "polygons", "group": "All"}))); add("feature to point", tool("featureToPoint", json!({"input": "polygons"}))); add("simplify", tool("simplify", json!({"input": "polygons", "tolerance": 5}))); add("select by location", tool("selectByLocation", json!({"input": "points", "select": "polygons", "distance": 1})));