geo/algorithm/
mod.rs

1/// Kernels to compute various predicates
2pub mod kernels;
3pub use kernels::{HasKernel, Kernel, Orientation};
4
5/// Calculate the area of the surface of a `Geometry`.
6pub mod area;
7pub use area::Area;
8
9/// Calculate the bearing to another `Point`, in degrees.
10#[deprecated(
11    since = "0.24.1",
12    note = "renamed to `haversine_bearing::HaversineBearing`"
13)]
14pub mod bearing;
15#[allow(deprecated)]
16#[deprecated(since = "0.24.1", note = "renamed to `HaversineBearing`")]
17pub use bearing::Bearing;
18
19/// Boolean Ops such as union, xor, difference;
20pub mod bool_ops;
21pub use bool_ops::{BooleanOps, OpType};
22
23/// Calculate the bounding rectangle of a `Geometry`.
24pub mod bounding_rect;
25pub use bounding_rect::BoundingRect;
26
27/// Calculate the minimum rotated rectangle of a `Geometry`.
28pub mod minimum_rotated_rect;
29pub use minimum_rotated_rect::MinimumRotatedRect;
30
31/// Calculate the centroid of a `Geometry`.
32pub mod centroid;
33pub use centroid::Centroid;
34
35/// Smoothen `LineString`, `Polygon`, `MultiLineString` and `MultiPolygon` using Chaikins algorithm.
36pub mod chaikin_smoothing;
37pub use chaikin_smoothing::ChaikinSmoothing;
38
39/// Calculate the signed approximate geodesic area of a `Geometry`.
40pub mod chamberlain_duquette_area;
41pub use chamberlain_duquette_area::ChamberlainDuquetteArea;
42
43/// Calculate the closest `Point` between a `Geometry` and an input `Point`.
44pub mod closest_point;
45pub use closest_point::ClosestPoint;
46
47/// Calculate the concave hull of a `Geometry`.
48pub mod concave_hull;
49pub use concave_hull::ConcaveHull;
50
51/// Determine whether `Geometry` `A` completely encloses `Geometry` `B`.
52pub mod contains;
53pub use contains::Contains;
54
55/// Convert the type of a geometry’s coordinate value.
56pub mod convert;
57pub use convert::{Convert, TryConvert};
58
59/// Calculate the convex hull of a `Geometry`.
60pub mod convex_hull;
61pub use convex_hull::ConvexHull;
62
63/// Determine whether a `Coord` lies inside, outside, or on the boundary of a geometry.
64pub mod coordinate_position;
65pub use coordinate_position::CoordinatePosition;
66
67/// Iterate over geometry coordinates.
68pub mod coords_iter;
69pub use coords_iter::CoordsIter;
70
71/// Densify linear geometry components
72pub mod densify;
73pub use densify::Densify;
74
75/// Dimensionality of a geometry and its boundary, based on OGC-SFA.
76pub mod dimensions;
77pub use dimensions::HasDimensions;
78
79/// Calculate the minimum Euclidean distance between two `Geometries`.
80pub mod euclidean_distance;
81pub use euclidean_distance::EuclideanDistance;
82
83/// Calculate the length of a planar line between two `Geometries`.
84pub mod euclidean_length;
85pub use euclidean_length::EuclideanLength;
86
87/// Calculate the extreme coordinates and indices of a geometry.
88pub mod extremes;
89pub use extremes::Extremes;
90
91/// Calculate the Frechet distance between two `LineStrings`.
92pub mod frechet_distance;
93pub use frechet_distance::FrechetDistance;
94
95/// Calculate the bearing to another `Point` on a geodesic.
96pub mod geodesic_bearing;
97pub use geodesic_bearing::GeodesicBearing;
98
99/// Returns a new Point using a distance and bearing on a geodesic.
100pub mod geodesic_destination;
101pub use geodesic_destination::GeodesicDestination;
102
103/// Calculate the Geodesic distance between two `Point`s.
104pub mod geodesic_distance;
105pub use geodesic_distance::GeodesicDistance;
106
107/// Calculate the Geodesic area and perimeter of polygons.
108pub mod geodesic_area;
109pub use geodesic_area::GeodesicArea;
110
111/// Calculate a new `Point` lying on a Geodesic arc between two `Point`s.
112pub mod geodesic_intermediate;
113pub use geodesic_intermediate::GeodesicIntermediate;
114
115/// Calculate the Geodesic length of a line.
116pub mod geodesic_length;
117pub use geodesic_length::GeodesicLength;
118
119/// Calculate the bearing to another `Point`, in degrees.
120pub mod haversine_bearing;
121pub use haversine_bearing::HaversineBearing;
122
123/// Calculate a destination `Point`, given a distance and a bearing.
124pub mod haversine_destination;
125pub use haversine_destination::HaversineDestination;
126
127/// Calculate the Haversine distance between two `Geometries`.
128pub mod haversine_distance;
129pub use haversine_distance::HaversineDistance;
130
131/// Calculate a new `Point` lying on a Great Circle arc between two `Point`s.
132pub mod haversine_intermediate;
133pub use haversine_intermediate::HaversineIntermediate;
134
135/// Calculate the Haversine length of a Line.
136pub mod haversine_length;
137pub use haversine_length::HaversineLength;
138
139/// Calculate a representative `Point` inside a `Geometry`
140pub mod interior_point;
141pub use interior_point::InteriorPoint;
142
143/// Determine whether `Geometry` `A` intersects `Geometry` `B`.
144pub mod intersects;
145pub use intersects::Intersects;
146
147/// Determines whether a `LineString` is convex.
148pub mod is_convex;
149pub use is_convex::IsConvex;
150
151/// Calculate concave hull using k-nearest algorithm
152pub mod k_nearest_concave_hull;
153pub use k_nearest_concave_hull::KNearestConcaveHull;
154
155/// Interpolate a point along a `Line` or `LineString`.
156pub mod line_interpolate_point;
157pub use line_interpolate_point::LineInterpolatePoint;
158
159/// Computes the intersection of two Lines.
160pub mod line_intersection;
161pub use line_intersection::LineIntersection;
162
163/// Locate a point along a `Line` or `LineString`.
164pub mod line_locate_point;
165pub use line_locate_point::LineLocatePoint;
166
167/// Iterate over the lines in a geometry.
168pub mod lines_iter;
169pub use lines_iter::LinesIter;
170
171/// Apply a function to all `Coord`s of a `Geometry`.
172pub mod map_coords;
173pub use map_coords::{MapCoords, MapCoordsInPlace};
174#[allow(deprecated)]
175pub use map_coords::{MapCoordsInplace, TryMapCoords, TryMapCoordsInplace};
176
177/// Orient a `Polygon`'s exterior and interior rings.
178pub mod orient;
179pub use orient::Orient;
180
181/// Coordinate projections and transformations using the current stable version of [PROJ](http://proj.org).
182#[cfg(feature = "use-proj")]
183pub mod proj;
184
185/// Relate two geometries based on DE-9IM
186pub mod relate;
187pub use relate::Relate;
188
189/// Remove (consecutive) repeated points
190pub mod remove_repeated_points;
191pub use remove_repeated_points::RemoveRepeatedPoints;
192
193/// Rotate a `Geometry` by an angle given in degrees.
194pub mod rotate;
195pub use rotate::Rotate;
196#[doc(hidden)]
197#[allow(deprecated)]
198pub use rotate::RotatePoint;
199
200/// Scale a `Geometry` up or down by a factor
201pub mod scale;
202pub use scale::Scale;
203
204/// Skew a `Geometry` by shearing it at angles along the x and y dimensions
205pub mod skew;
206pub use skew::Skew;
207
208/// Composable affine operations such as rotate, scale, skew, and translate
209pub mod affine_ops;
210pub use affine_ops::{AffineOps, AffineTransform};
211
212/// Simplify `Geometries` using the Ramer-Douglas-Peucker algorithm.
213pub mod simplify;
214pub use simplify::{Simplify, SimplifyIdx};
215
216/// Simplify `Geometries` using the Visvalingam-Whyatt algorithm. Includes a topology-preserving variant.
217pub mod simplify_vw;
218pub use simplify_vw::{SimplifyVw, SimplifyVwIdx, SimplifyVwPreserve};
219
220/// Transform a geometry using PROJ.
221#[cfg(feature = "use-proj")]
222pub mod transform;
223#[cfg(feature = "use-proj")]
224pub use transform::Transform;
225
226/// Translate a `Geometry` along the given offsets.
227pub mod translate;
228pub use translate::Translate;
229
230/// Calculate the Vincenty distance between two `Point`s.
231pub mod vincenty_distance;
232pub use vincenty_distance::VincentyDistance;
233
234/// Calculate the Vincenty length of a `LineString`.
235pub mod vincenty_length;
236pub use vincenty_length::VincentyLength;
237
238/// Calculate and work with the winding order of `Linestring`s.
239pub mod winding_order;
240pub use winding_order::Winding;
241
242/// Determine whether `Geometry` `A` is completely within by `Geometry` `B`.
243pub mod within;
244pub use within::Within;
245
246/// Planar sweep algorithm and related utils
247pub mod sweep;
248
249/// Detect outliers in a group of points using [LOF](https://en.wikipedia.org/wiki/Local_outlier_factor)
250pub mod outlier_detection;
251pub use outlier_detection::OutlierDetection;