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

Function envelope_polygon

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

Source from the content-addressed store, hash-verified

329
330 #[test]
331 fn envelope_polygon() {
332 let poly = Geometry::polygon(vec![vec![[1.0, 2.0], [5.0, 2.0], [3.0, 8.0], [1.0, 2.0]]]);
333 let env = st_envelope(&poly);
334 if let Geometry::Polygon { coordinates } = &env {
335 let ring = &coordinates[0];
336 assert_eq!(ring[0], [1.0, 2.0]); // min_lng, min_lat
337 assert_eq!(ring[2], [5.0, 8.0]); // max_lng, max_lat
338 } else {
339 panic!("expected Polygon");
340 }
341 }
342
343 #[test]
344 fn envelope_point() {

Callers

nothing calls this directly

Calls 1

st_envelopeFunction · 0.85

Tested by

no test coverage detected