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

Function polygon_roundtrip

nodedb-spatial/src/wkt.rs:288–300  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

286
287 #[test]
288 fn polygon_roundtrip() {
289 let geom = Geometry::polygon(vec![vec![
290 [0.0, 0.0],
291 [10.0, 0.0],
292 [10.0, 10.0],
293 [0.0, 10.0],
294 [0.0, 0.0],
295 ]]);
296 let wkt = geometry_to_wkt(&geom);
297 assert!(wkt.starts_with("POLYGON("));
298 let parsed = geometry_from_wkt(&wkt).unwrap();
299 assert_eq!(geom, parsed);
300 }
301
302 #[test]
303 fn polygon_with_hole_roundtrip() {

Callers

nothing calls this directly

Calls 2

geometry_to_wktFunction · 0.85
geometry_from_wktFunction · 0.85

Tested by

no test coverage detected