()
| 302 | |
| 303 | #[test] |
| 304 | fn buffer_point_circle() { |
| 305 | let circle = st_buffer(&Geometry::point(0.0, 0.0), 1000.0, 32); |
| 306 | if let Geometry::Polygon { coordinates } = &circle { |
| 307 | assert_eq!(coordinates.len(), 1); |
| 308 | // 32 segments + 1 closing point. |
| 309 | assert_eq!(coordinates[0].len(), 33); |
| 310 | // All points should be roughly 1000m from center. |
| 311 | for pt in &coordinates[0][..32] { |
| 312 | let d = nodedb_types::geometry::haversine_distance(0.0, 0.0, pt[0], pt[1]); |
| 313 | assert!((d - 1000.0).abs() < 50.0, "d={d}"); |
| 314 | } |
| 315 | } else { |
| 316 | panic!("expected Polygon"); |
| 317 | } |
| 318 | } |
| 319 | |
| 320 | #[test] |
| 321 | fn buffer_point_4_segments() { |
nothing calls this directly
no test coverage detected