Strip the closing vertex from a ring if present.
(ring: &[[f64; 2]])
| 188 | |
| 189 | /// Strip the closing vertex from a ring if present. |
| 190 | fn strip_closing(ring: &[[f64; 2]]) -> Vec<[f64; 2]> { |
| 191 | if ring.len() >= 2 && ring.first() == ring.last() { |
| 192 | ring[..ring.len() - 1].to_vec() |
| 193 | } else { |
| 194 | ring.to_vec() |
| 195 | } |
| 196 | } |
| 197 | |
| 198 | /// Clip a linestring to a polygon: keep only the parts inside. |
| 199 | fn clip_linestring_to_polygon(line: &[[f64; 2]], rings: &[Vec<[f64; 2]>]) -> Geometry { |
no test coverage detected