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

Function wkb_bbox_extraction

nodedb-spatial/src/wkb.rs:407–421  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

405
406 #[test]
407 fn wkb_bbox_extraction() {
408 let geom = Geometry::polygon(vec![vec![
409 [-10.0, -5.0],
410 [10.0, -5.0],
411 [10.0, 5.0],
412 [-10.0, 5.0],
413 [-10.0, -5.0],
414 ]]);
415 let wkb = geometry_to_wkb(&geom);
416 let bb = wkb_bbox(&wkb).unwrap();
417 assert_eq!(bb.min_lng, -10.0);
418 assert_eq!(bb.max_lng, 10.0);
419 assert_eq!(bb.min_lat, -5.0);
420 assert_eq!(bb.max_lat, 5.0);
421 }
422
423 #[test]
424 fn point_wkb_size() {

Callers

nothing calls this directly

Calls 2

geometry_to_wkbFunction · 0.85
wkb_bboxFunction · 0.85

Tested by

no test coverage detected