geo

Geospatial primitives and algorithms for Rust, built on the georust ecosystem

Library
Cargo
v0.33.1
1,914stars
Custom / Unknown

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
77/100Good
Development Activity88
Maintenance44
Community76
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
76/100Good
Architecture80
Code Quality82
Innovation75
Learning Curve65

geo provides fundamental geospatial primitives (points, lines, polygons, multi-geometries) and a large library of algorithms — area, centroid, convex hull, boolean operations, buffering, simplification, distance/bearing calculations, and more — for working with 2D geometry in Rust. It builds on the geo-types crate for its core data structures and integrates with the wider georust ecosystem (WKT, GeoJSON, PROJ) for real-world GIS workflows.

What You Get

  • Core geometry types re-exported from geo-types (Point, LineString, Polygon, MultiPolygon, etc.) plus algorithm traits implemented on them
  • 68+ algorithm modules covering area, centroid, convex hull, buffering, simplification, boolean ops, distance/bearing/geodesic calculations, and Delaunay triangulation
  • Optional integrations for PROJ (coordinate reprojection), serde (serialization), and spade (Delaunay triangulation backend)
  • Multithreading support for compute-heavy operations like polygon overlay via the i_overlay dependency
  • An extensive test suite including a JTS-compatibility test runner validating results against the reference Java Topology Suite

Common Use Cases

  • Computing area, centroid, or bounding box of geographic features in a mapping or GIS application
  • Performing polygon boolean operations (union, intersection, difference) for spatial analysis pipelines
  • Simplifying or buffering geometries for rendering at different zoom levels in map-based applications
  • Calculating geodesic distances and bearings between coordinates for routing or proximity queries

Under The Hood

Architecture - The geo crate (geo/src/algorithm/, 68+ modules) implements each geometric operation as a trait extending the core types defined in the sibling geo-types crate, so operations like .area(), .convex_hull(), or .simplify() are called directly on Point/LineString/Polygon values; the workspace also includes geo-traits (shared trait definitions for interop with other georust crates), geo-test-fixtures (shared test geometries), and jts-test-runner, which cross-validates geo’s algorithm outputs against Java Topology Suite reference results.

Tech Stack - Nearly pure Rust (99.96%) on the 2024 edition (rust-version 1.88), depending on geo-types for core structures, geographiclib-rs and robust for numerically-robust geodesic/predicate computations, rstar for spatial R-tree indexing, and optional integrations with spade (Delaunay triangulation), proj (coordinate reprojection via libproj bindings), and i_overlay (multithreaded polygon overlay).

Code Quality - The geo crate alone contains 129+ files with #[test] functions, and the dedicated jts-test-runner crate cross-checks algorithm correctness against the industry-standard JTS reference implementation, which is an unusually rigorous validation approach for a geometry library; the project has 134 contributors and very active recent commit history, indicating sustained peer review and maintenance.

API Design - Algorithms are exposed as traits implemented directly on the geometry types, so usage reads naturally as method calls (polygon.area(), line.haversine_distance(&other)) rather than free functions taking geometry arguments, and feature flags cleanly separate optional heavy dependencies (PROJ, spade) from the default build so users only pull in what they need.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search