MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / union_polygons

Function union_polygons

nodedb-spatial/src/operations.rs:368–377  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

366
367 #[test]
368 fn union_polygons() {
369 let a = Geometry::polygon(vec![vec![[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 0.0]]]);
370 let b = Geometry::polygon(vec![vec![[2.0, 2.0], [3.0, 2.0], [3.0, 3.0], [2.0, 2.0]]]);
371 let u = st_union(&a, &b);
372 if let Geometry::MultiPolygon { coordinates } = &u {
373 assert_eq!(coordinates.len(), 2);
374 } else {
375 panic!("expected MultiPolygon");
376 }
377 }
378
379 #[test]
380 fn union_mixed_types() {

Callers

nothing calls this directly

Calls 1

st_unionFunction · 0.85

Tested by

no test coverage detected