geo crate provides geospatial primitive types and algorithms.
Coordinate: A two-dimensional coordinate. All geometry types are composed of
Coordinateitself is not a
Point: A single point represented by one
MultiPoint: A collection of
Line: A line segment represented by two
LineString: A series of contiguous line segments represented by two or more
MultiLineString: A collection of
Polygon: A bounded area represented by one
LineStringexterior ring, and zero or more
MultiPolygon: A collection of
Rect: An axis-aligned bounded rectangle represented by minimum and maximum
Triangle: A bounded area represented by three
GeometryCollection: A collection of
Geometry: An enumeration of all geometry types, excluding
The preceding types are reexported from the
geo-types crate. Consider using that crate
if you only need access to these types and no other
Area: Calculate the planar area of a geometry
ChamberlainDuquetteArea: Calculate the geodesic area of a geometry
EuclideanDistance: Calculate the minimum euclidean distance between geometries
GeodesicDistance: Calculate the minimum geodesic distance between geometries using the algorithm presented in Algorithms for geodesics by Charles Karney (2013)
HaversineDistance: Calculate the minimum geodesic distance between geometries using the haversine formula
VincentyDistance: Calculate the minimum geodesic distance between geometries using Vincenty’s formula
EuclideanLength: Calculate the euclidean length of a geometry
GeodesicLength: Calculate the geodesic length of a geometry using the algorithm presented in Algorithms for geodesics by Charles Karney (2013)
HaversineLength: Calculate the geodesic length of a geometry using the haversine formula
VincentyLength: Calculate the geodesic length of a geometry using Vincenty’s formula
Simplify: Simplify a geometry using the Ramer–Douglas–Peucker algorithm
SimplifyIdx: Calculate a simplified geometry using the Ramer–Douglas–Peucker algorithm, returning coordinate indices
SimplifyVW: Simplify a geometry using the Visvalingam-Whyatt algorithm
SimplifyVWPreserve: Simplify a geometry using a topology-preserving variant of the Visvalingam-Whyatt algorithm
SimplifyVwIdx: Calculate a simplified geometry using a topology-preserving variant of the Visvalingam-Whyatt algorithm, returning coordinate indices
Bearing: Calculate the bearing between points
ClosestPoint: Find the point on a geometry closest to a given point
IsConvex: Calculate the convexity of a
LineInterpolatePoint: Generates a point that lies a given fraction along the line
LineLocatePoint: Calculate the fraction of a line’s total length representing the location of the closest point on the line to the given point
Contains: Calculate if a geometry contains another geometry
CoordinatePosition: Calculate the position of a coordinate relative to a geometry
HasDimensions: Determine the dimensions of a geometry
Intersects: Calculate if a geometry intersects another geometry
line_intersection: Calculates the intersection, if any, between two lines.
Relate: Topologically relate two geometries based on DE-9IM semantics.
Orient: Apply a specified
Polygon’s interior and exterior rings
Winding: Calculate and manipulate the winding order of a
CoordsIter: Iterate over the coordinates of a geometry
MapCoords: Map a function over all the coordinates in a geometry, returning a new geometry
MapCoordsInplace: Map a function over all the coordinates in a geometry in-place
TryMapCoords: Map a fallible function over all the coordinates in a geometry, returning a new geometry wrapped in a
BoundingRect: Calculate the axis-aligned bounding rectangle of a geometry
ConcaveHull: Calculate the concave hull of a geometry
ConvexHull: Calculate the convex hull of a geometry
Extremes: Calculate the extreme coordinates and indices of a geometry
Rotate: Rotate a geometry around its centroid
RotatePoint: Rotate a geometry around a point
Translate: Translate a geometry along its axis
Centroid: Calculate the centroid of a geometry
Proj: Project geometries with the
The following optional Cargo features are available:
proj-network: Enables network grid support for the
projcrate. After enabling this feature, further configuration is required to use the network grid
use-proj: Enables coordinate conversion and transformation of
Pointgeometries using the
use-serde: Allows geometry types to be serialized and deserialized with Serde
There’s a wide variety of
geo-compatible crates in the ecosystem that offer functionality not
included in the
geo crate, including:
This module includes all the functions of geometric calculations
A prelude which re-exports the traits for manipulating objects in this
crate. Typically imported with
Implements the common pattern where a Geometry enum simply delegates its trait impl to it’s inner type.
A lightweight struct used to store coordinates on the 2-dimensional Cartesian plane.
A collection of
A line segment made up of exactly two
An ordered collection of two or more
A collection of
A collection of
A collection of
A single point in 2D space.
A bounded two-dimensional area.
An axis-aligned bounded 2D rectangle whose area is
defined by minimum and maximum
A bounded 2D area whose three vertices are defined by
The result of trying to find the closest spot on an object to a point.
An enum representing any possible geometry type.
The type of an x or y value of a point/coordinate.
A common numeric trait used for geo algorithms.