Skip to content

✔️Geometry validation for the rust geo/geo-types library

Notifications You must be signed in to change notification settings

jtmiclat/geo-valid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

✔️Geometry validation for the rust geo/geo-types library

Topics

Resources

Stars

Watchers

Forks

Languages