A pure rust module for validating geometries. Inspired by Geos Geometry Validation Module
use geo_types::{Point, Polygon};
use geo_valid::{validate, Validation};
let validation: Validation = validate(Point(1., 2.));
validation.is_valid;
// true
let self_intersecting_polygon = Polygon::new(
LineString::from(vec![(0., 0.), (2., 2.), (2., 0.), (0., 2.)]),
vec![],
);
let validaiton: Validaiton = validate(self_intersecting_polygon);
validation.is_valid;
// false
cargo install
cargo test --lib
For test coverage
cargo tarpaulin
- Add docs
- Publish
- Support early exit once a single validation check fails
- Investigate if geo-valid will support Line, Rect, and Triangle