Skip to content

Latest commit

 

History

History
43 lines (36 loc) · 953 Bytes

README.md

File metadata and controls

43 lines (36 loc) · 953 Bytes

Geometry Validation for geo/geo-types

A pure rust module for validating geometries. Inspired by Geos Geometry Validation Module

Usage

Basic usage

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

Dev Setup

Installing

cargo install

Run tests

cargo test --lib

For test coverage

cargo tarpaulin

TODO

  • Add docs
  • Publish
  • Support early exit once a single validation check fails
  • Investigate if geo-valid will support Line, Rect, and Triangle