1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
//! This package provides two traits for (Multi)Polygon: repair and merge
//!
//! When running repair, it will try its best to produce a (Multi)Polygon
//! that meets OGC standards. Some very invalid polygons still fail, but
//! most come through as valid with very little change.
//!
//! The join trait for MultiPolygon will merge all of its Polygons
//! into a single valid Polygon. This may involve a union or the
//! creation of a small bridge between the closes points of non-overlapping
//! Polygons.
//!
mod close_poly;
mod dedup_poly_point;
mod fix_intersecting_rings;
mod fix_point_touching_ring_line;
mod fix_self_intersecting_ring;
pub mod join;
pub mod repair;

use float_next_after::NextAfter;
use geo_booleanop::boolean::Float;
use std::fmt;

pub trait GeoRepairFloat:
    Float + NextAfter<Self> + fmt::Display + num_traits::cast::FromPrimitive + std::iter::Sum
{
}
impl<T: Float + NextAfter<T> + fmt::Display + num_traits::cast::FromPrimitive + std::iter::Sum>
    GeoRepairFloat for T
{
}