• Stars
    star
    1,247
  • Rank 37,683 (Top 0.8 %)
  • Language
    Rust
  • License
    Other
  • Created almost 10 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Geospatial primitives and algorithms for Rust

geo

geo on Crates.io Coverage Status Documentation Discord

geo

Geospatial Primitives, Algorithms, and Utilities

Chat or ask questions on Discord

The geo crate provides geospatial primitive types such as Point, LineString, and Polygon, and provides algorithms and operations such as:

  • Area and centroid calculation
  • Simplification and convex hull operations
  • Euclidean and Haversine distance measurement
  • Intersection checks
  • Affine transforms such as rotation and translation
  • All DE-9IM spatial predicates such as contains, crosses, and touches.

Please refer to the documentation for a complete list.

The primitive types also provide the basis for other functionality in the Geo ecosystem, including:

Example

// primitives
use geo::{line_string, polygon};

// algorithms
use geo::ConvexHull;

// An L shape
let poly = polygon![
    (x: 0.0, y: 0.0),
    (x: 4.0, y: 0.0),
    (x: 4.0, y: 1.0),
    (x: 1.0, y: 1.0),
    (x: 1.0, y: 4.0),
    (x: 0.0, y: 4.0),
    (x: 0.0, y: 0.0),
];

// Calculate the polygon's convex hull
let hull = poly.convex_hull();

assert_eq!(
    hull.exterior(),
    &line_string![
        (x: 4.0, y: 0.0),
        (x: 4.0, y: 1.0),
        (x: 1.0, y: 4.0),
        (x: 0.0, y: 4.0),
        (x: 0.0, y: 0.0),
        (x: 4.0, y: 0.0),
    ]
);

Contributing

Contributions are welcome! Have a look at the issues, and open a pull request if you'd like to add an algorithm or some functionality.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

More Repositories

1

rstar

R*-tree spatial index for the Rust ecosystem
Rust
384
star
2

geozero

Zero-Copy reading and writing of geospatial data.
Rust
355
star
3

gdal

Rust bindings for GDAL
Rust
342
star
4

geojson

Library for serializing the GeoJSON vector GIS file format
Rust
222
star
5

proj

Rust bindings for the latest stable release of PROJ
Rust
131
star
6

geos

Rust bindings for GEOS
Rust
87
star
7

gpx

Rust read/write support for GPS Exchange Format (GPX)
Rust
84
star
8

geohash

Geohash for Rust
Rust
84
star
9

netcdf

High-level netCDF bindings for Rust
Rust
81
star
10

rinex

RINEX and GNSS data processing πŸ›°οΈ
Rust
80
star
11

geotiff

Reading GeoTIFFs in Rust, nothing else!
Rust
69
star
12

geocoding

Geocoding library for Rust.
Rust
63
star
13

robust

Robust predicates for computational geometry
Rust
51
star
14

wkt

Rust read/write support for well-known text (WKT)
Rust
43
star
15

geographiclib-rs

A port of geographiclib in Rust.
Rust
41
star
16

kml

Rust support for KML
Rust
27
star
17

polyline

Google Encoded Polyline encoding & decoding in Rust.
Rust
17
star
18

osm

OSM XML serialization and other OpenStreetMap utilities
Rust
16
star
19

transitfeed

Public transit serializer/deserializer and manipulation library for Rust
Rust
16
star
20

ogcapi

OGC API building blocks implemented in Rust
Rust
14
star
21

topojson

TopoJSON bindings and utilities for Rust
Rust
10
star
22

world-file

Rust read/write support for world files
Rust
7
star
23

shapefile

Rust read/write support for shapefiles
HTML
7
star
24

tilejson

Library for serializing the TileJSON file format
Rust
6
star
25

geos-sys

FFI bindings for libgeos
C++
5
star
26

geo-svg

A rust library to generate SVGs for geo-types
Rust
5
star
27

georust.org

georust.org
3
star
28

meta

The GeoRust Team repository for coordinating and discussing GeoRust projects
Shell
1
star
29

docker-images

Docker images used in the GeoRust ecosystem
Makefile
1
star