Rust bindings for GEOS

Overview

geos

Build Status

Rust bindings for GEOS C API.

The supported geos version is >= 3.5

Disclaimer

GEOS can be a tad strict on the validity on the input geometry and is prone to crash on invalid input, so they need to be checked in the wrapper. This project is checked with valgrind, but if you stumble on a crash feel free to open an issue explaining the problem.

Usage example

You can check the examples in the examples/ directory.

Constructing geometries from WKT:

extern crate geos;

let gg1 = geos::Geometry::new_from_wkt("POLYGON ((0 0, 0 5, 6 6, 6 0, 0 0))").expect("invalid WKT");
let gg2 = geos::Geometry::new_from_wkt("POLYGON ((1 1, 1 3, 5 5, 5 1, 1 1))").expect("invalid WKT");
let gg3 = gg1.difference(&gg2).expect("difference failed");
assert_eq!(
    gg3.to_wkt_precision(0).expect("to_wkt failed"),
    "POLYGON ((0 0, 0 5, 6 6, 6 0, 0 0), (1 1, 5 1, 5 5, 1 3, 1 1))",
);

"Preparing" the geometries for faster predicates (intersects, contains, etc.) computation on repetitive calls:

extern crate geos;

let g1 = geos::Geometry::new_from_wkt("POLYGON ((0 0, 0 5, 5 5, 5 0, 0 0))").expect("invalid WKT");
let g2 = geos::Geometry::new_from_wkt("POLYGON ((1 1, 1 3, 5 5, 5 0, 1 1))").expect("invalid WKT");

let pg1 = geos::PreparedGeometry::new(&g1).expect("PreparedGeometry::new failed");
let result = pg1.intersects(&g2).expect("intersects failed");
assert_eq!(result, true);

Conversion from geo

geo's objects can be converted into GEOS to use all geos algorithms.

Complete example can be found in examples/from_geo.rs

extern crate geos;
extern crate geo_types;

use geos::from_geo::TryInto;
use geo_types::{LineString, Coordinate, Polygon};

// first we create a Geo object
let exterior = LineString(vec![
    Coordinate::from((0., 0.)),
    Coordinate::from((0., 1.)),
    Coordinate::from((1., 1.)),
]);
let interiors = vec![
    LineString(vec![
        Coordinate::from((0.1, 0.1)),
        Coordinate::from((0.1, 0.9)),
        Coordinate::from((0.9, 0.9)),
    ]),
];
let p = Polygon::new(exterior, interiors);
// and we can create a Geos geometry from this object
let geom: geos::Geometry = (&p).try_into().expect("failed conversion");
// do some stuff with geom

Voronoi

Voronoi diagrams computation are available in the bindings.

For those to be easier to use with geo some helpers are available in voronoi.rs.

extern crate geo_types;

use geo_types::Point;
let points = vec![
    Point::new(0., 0.),
    Point::new(0., 1.),
    Point::new(1., 1.),
    Point::new(1., 0.),
];

let voronoi = geos::compute_voronoi(&points, None, 0., false).expect("compute_voronoi failed");

Contributing

Only a subset of geos has been implemented, feel free to add wrappers for missing features.

All added features needs to be tested and this being a C wrapper, valgrind runs on all examples/tests to check that no bugs / memory leaks are lurking.

Comments
  • ENH: migrate geos-sys to bindgen and prebuilt GEOS bindings

    ENH: migrate geos-sys to bindgen and prebuilt GEOS bindings

    This builds out a bindgen based build step roughly similar to georust/gdal, which uses prebuilt bindings for each supported version. This should make it easier to add new versions in the future and version-specific behavior to the main crate.

    Adds prebuilt bindings for GEOS:

    • 3.7.3
    • 3.8.3
    • 3.9.3
    • 3.10.3
    • 3.11.0 (in progress, pending final release)

    I have been unable to get GEOS 3.6.5 to build statically, and I believe 3.6.x is no longer being maintained (last update was late 2020); it might make sense to drop GEOS 3.6 support from here relatively soon.

    This adds a check against a minimum supported version of GEOS, which seems like a good idea to avoid very old versions.

    The build step uses either pkg-config (only available for GEOS >= 3.9) or falls back to geos-config to attempt to discover the location and version of system-installed GEOS and dynamically link to it. This seems to work OK for Linux / macOS; I don't see that there was previous support here for Windows builds, so I didn't add any in this PR (could presumably be added in a future PR). You can also set a few env vars to specify the location of GEOS.

    The static build of GEOS is roughly as it was before, and should always correspond to a version for which there are bindings available (since it is based on a particular commit in the GEOS submodule). I was able to use that to build version-specific bindngs for most versions.

    This removes the hand-crafted GEOS bindings and associated script. The bindgen bindings here use libc, similar to the original bindings, and also specifically exclude functions excluded previously. Overall, the bindings look nearly identical; I didn't spot meaningful differences.

    This deprecates version features from geos-sys (they are retained but have no affect); these are obviated by having version-specific bindings. At some point soon (if this gets merged), version features should be deprecated and replaced by version detection similar to georust/gdal

    Since this includes a breaking changes to the geos-sys build process (i.e., if autodetection of GEOS fails badly or bindings aren't available for a specific version), we should probably note that someplace, but I haven't added anything yet.

    Most of the tests pass except for a few in more recent versions of GEOS that are based on underlying GEOS logic changes that will need to be better handled in those tests (e.g., coordinate order within polygons). I haven't yet investigated the valgrind related errors, but I see that is failing on the master branch too. I haven't yet seen any errors that indicate a fault in the bindings.

    This includes some updates to the CI config to run on all the GEOS versions for which pre-built bindings are available. These leverage the GEOS submodule and attempt to use ccache to speed up the build, though that seems to be held up by the test failures.

    Lastly, I'm pretty new to Rust, so there is always the chance that I've made dumb or non-idiomatic mistakes here.

    (keeping this as draft until I can track down the failures & review memory leaks)

    opened by brendan-ward 24
  • create a PreparedGeometry<'static> from a Geometry<'static> and dropping the latter makes the first unusable

    create a PreparedGeometry<'static> from a Geometry<'static> and dropping the latter makes the first unusable

    Seems like the PreparedGeometry should have a lifetime dependency on the original Geometry. When I try to use the the PreparedGeometry after dropping the original one I get various errors and sigabrts, including messages like pure virtual method called (which could have been a coincidence).

    opened by gauteh 11
  • crates publishing team

    crates publishing team

    👋 Hi @GuillaumeGomez and @antoine-de, you two are the only "user-owners" of the geos crate on crates.io, so only you can edit that crate's owners on crates.io.

    Following up on https://github.com/georust/meta/pull/21, I created a new geos-publishers team for publishing to crates.io with you as maintainer.

    Could you please update the crate owners? Specifically:


    • [ ] @GuillaumeGomez or @antoine-de: update geos crate owners on crates.io:
    cd geos
    
    # 💥 remove large publishing team
    cargo owner --remove github:georust:core
    
    # 🔐 add small publishing team
    cargo owner --add github:georust:geos-publishers
    
    # make sure everything looks good 👀 
    cargo owner --list
    

    • [ ] @GuillaumeGomez: update geos-sys crate owners on crates.io:
    cd geos
    
    # 💥 geos-sys didn't have the georust/core team as a team-owner
    # 🔐 add small publishing team (assuming you'd prefer to share a publishing team between geos and geos-sys crates)
    cargo owner --add github:georust:geos-publishers
    
    # 🚨 @GuillaumeGomez: note that you are the *sole* user-owner of the geos-sys crate. 
    # Consider adding another user-owner so that someone can still update the crate owners if you become inaccessible. Maybe @antoine-de?
    cargo owner --add antoine-de
    
    # make sure everything looks good 👀 
    cargo owner --list
    

    If there's anyone else you'd like to be able to publish the crates, feel free to add them to your publishing team, or as a user-owner. Consider that user-owners, as opposed to owners-via-team, can themselves edit the crate's owners, which could be desirable, or not, depending.

    Once you switch the publishing team, no one else will be able to publish until either they are added to the new publishing team or added as a user-owner.

    Let me know if you have any questions, or you can review https://github.com/georust/meta/pull/21.

    opened by michaelkirk 11
  • Implement voronoi binding

    Implement voronoi binding

    add a binding to the libgeos voronoi computation function.

    To use it more easily with rust-geo I added a simple wrapper to the geos binding.

    It can thus be used either with pure geos:

    let points = "MULTIPOINT ((150 200), (180 270), (275 163))";
    let input = GGeom::new(points)?;
    let voronoi = input.voronoi(None, 0., false)?;
    

    or with rust-geo:

    use geo_types::Point;
    let points = vec![
        Point::new(0., 0.),
        Point::new(0., 1.),
        Point::new(1., 1.),
        Point::new(1., 0.),
    ];
    let _voronoi = geos::compute_voronoi(&points, 0.)?;
    

    For the moment to make the geos -> geo conversion, since I don't have much time (It's my last day in my current position :tada: ) I used wkt as a pivot format (thus geos -> wkt -> geo) It's obviously very inefficient. We should at least use wkb, or even better custom converter.

    This PR is usable, ibut it's still a bit WIP since I'd like to test it's use in a real use case (voronoi computation in cosmogony It's also WIp because it depends on https://github.com/georust/wkt/pull/38

    opened by antoine-de 10
  • TST: Update tests to pass on GEOS 3.6 - 3.11

    TST: Update tests to pass on GEOS 3.6 - 3.11

    This updates and simplifies the tests that were breaking on GEOS > 3.6 so that they run on all versions 3.6 - 3.11.

    I understand that some of the doctests use geometires from the PostGIS documentation. However, these are more complex than necessary for simple examples, so I simplified these down for clarity and to ensure they pass.

    opened by brendan-ward 4
  • Fixed issue causing build to break on ARM.

    Fixed issue causing build to break on ARM.

    #20 199.4    Compiling geos v8.0.0
    #20 202.9 error[E0308]: mismatched types
    #20 202.9   --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/geos-8.0.0/src/prepared_geometry.rs:93:30
    #20 202.9    |
    #20 202.9 93 |         check_geos_predicate(ret_val, PredicateType::PreparedContains)
    #20 202.9    |                              ^^^^^^^ expected `i8`, found `u8`
    #20 202.9    |
    #20 202.9 help: you can convert a `u8` to an `i8` and panic if the converted value doesn't fit
    #20 202.9    |
    #20 202.9 93 |         check_geos_predicate(ret_val.try_into().unwrap(), PredicateType::PreparedContains)
    #20 202.9    |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    #20 202.9 
    #20 202.9 error[E0308]: mismatched types
    #20 202.9    --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/geos-8.0.0/src/prepared_geometry.rs:117:30
    #20 202.9     |
    #20 202.9 117 |         check_geos_predicate(ret_val, PredicateType::PreparedContainsProperly)
    #20 202.9     |                              ^^^^^^^ expected `i8`, found `u8`
    #20 202.9     |
    #20 202.9 help: you can convert a `u8` to an `i8` and panic if the converted value doesn't fit
    #20 202.9     |
    #20 202.9 117 |         check_geos_predicate(ret_val.try_into().unwrap(), PredicateType::PreparedContainsProperly)
    #20 202.9     |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    #20 202.9 
    #20 202.9 error[E0308]: mismatched types
    #20 202.9    --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/geos-8.0.0/src/prepared_geometry.rs:146:30
    #20 202.9     |
    #20 202.9 146 |         check_geos_predicate(ret_val, PredicateType::PreparedCoveredBy)
    #20 202.9     |                              ^^^^^^^ expected `i8`, found `u8`
    #20 202.9     |
    #20 202.9 help: you can convert a `u8` to an `i8` and panic if the converted value doesn't fit
    #20 202.9     |
    #20 202.9 146 |         check_geos_predicate(ret_val.try_into().unwrap(), PredicateType::PreparedCoveredBy)
    #20 202.9     |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    #20 202.9 
    #20 202.9 error[E0308]: mismatched types
    #20 202.9    --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/geos-8.0.0/src/prepared_geometry.rs:174:30
    #20 202.9     |
    #20 202.9 174 |         check_geos_predicate(ret_val, PredicateType::PreparedCovers)
    #20 202.9     |                              ^^^^^^^ expected `i8`, found `u8`
    #20 202.9     |
    #20 202.9 help: you can convert a `u8` to an `i8` and panic if the converted value doesn't fit
    #20 202.9     |
    #20 202.9 174 |         check_geos_predicate(ret_val.try_into().unwrap(), PredicateType::PreparedCovers)
    #20 202.9     |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    #20 202.9 
    #20 202.9 error[E0308]: mismatched types
    #20 202.9    --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/geos-8.0.0/src/prepared_geometry.rs:195:30
    #20 202.9     |
    #20 202.9 195 |         check_geos_predicate(ret_val, PredicateType::PreparedCrosses)
    #20 202.9     |                              ^^^^^^^ expected `i8`, found `u8`
    #20 202.9     |
    #20 202.9 help: you can convert a `u8` to an `i8` and panic if the converted value doesn't fit
    #20 202.9     |
    #20 202.9 195 |         check_geos_predicate(ret_val.try_into().unwrap(), PredicateType::PreparedCrosses)
    #20 202.9     |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    #20 202.9 
    #20 202.9 error[E0308]: mismatched types
    #20 202.9    --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/geos-8.0.0/src/prepared_geometry.rs:226:30
    #20 202.9     |
    #20 202.9 226 |         check_geos_predicate(ret_val, PredicateType::PreparedDisjoint)
    #20 202.9     |                              ^^^^^^^ expected `i8`, found `u8`
    #20 202.9     |
    #20 202.9 help: you can convert a `u8` to an `i8` and panic if the converted value doesn't fit
    #20 202.9     |
    #20 202.9 226 |         check_geos_predicate(ret_val.try_into().unwrap(), PredicateType::PreparedDisjoint)
    #20 202.9     |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    #20 202.9 
    #20 202.9 error[E0308]: mismatched types
    #20 202.9    --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/geos-8.0.0/src/prepared_geometry.rs:260:30
    #20 202.9     |
    #20 202.9 260 |         check_geos_predicate(ret_val, PredicateType::PreparedIntersects)
    #20 202.9     |                              ^^^^^^^ expected `i8`, found `u8`
    #20 202.9     |
    #20 202.9 help: you can convert a `u8` to an `i8` and panic if the converted value doesn't fit
    #20 202.9     |
    #20 202.9 260 |         check_geos_predicate(ret_val.try_into().unwrap(), PredicateType::PreparedIntersects)
    #20 202.9     |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    #20 202.9 
    #20 202.9 error[E0308]: mismatched types
    #20 202.9    --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/geos-8.0.0/src/prepared_geometry.rs:292:30
    #20 202.9     |
    #20 202.9 292 |         check_geos_predicate(ret_val, PredicateType::PreparedOverlaps)
    #20 202.9     |                              ^^^^^^^ expected `i8`, found `u8`
    #20 202.9     |
    #20 202.9 help: you can convert a `u8` to an `i8` and panic if the converted value doesn't fit
    #20 202.9     |
    #20 202.9 292 |         check_geos_predicate(ret_val.try_into().unwrap(), PredicateType::PreparedOverlaps)
    #20 202.9     |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    #20 202.9 
    #20 202.9 error[E0308]: mismatched types
    #20 202.9    --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/geos-8.0.0/src/prepared_geometry.rs:319:30
    #20 202.9     |
    #20 202.9 319 |         check_geos_predicate(ret_val, PredicateType::PreparedTouches)
    #20 202.9     |                              ^^^^^^^ expected `i8`, found `u8`
    #20 202.9     |
    #20 202.9 help: you can convert a `u8` to an `i8` and panic if the converted value doesn't fit
    #20 202.9     |
    #20 202.9 319 |         check_geos_predicate(ret_val.try_into().unwrap(), PredicateType::PreparedTouches)
    #20 202.9     |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    #20 202.9 
    #20 202.9 error[E0308]: mismatched types
    #20 202.9    --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/geos-8.0.0/src/prepared_geometry.rs:348:30
    #20 202.9     |
    #20 202.9 348 |         check_geos_predicate(ret_val, PredicateType::PreparedWithin)
    #20 202.9     |                              ^^^^^^^ expected `i8`, found `u8`
    #20 202.9     |
    #20 202.9 help: you can convert a `u8` to an `i8` and panic if the converted value doesn't fit
    #20 202.9     |
    #20 202.9 348 |         check_geos_predicate(ret_val.try_into().unwrap(), PredicateType::PreparedWithin)
    #20 202.9     |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    #20 202.9 
    #20 203.4 error: aborting due to 10 previous errors
    #20 203.4 
    #20 203.5 For more information about this error, try `rustc --explain E0308`.
    #20 203.5 error: could not compile `geos`
    #20 203.5 
    #20 203.5 To learn more, run the command again with --verbose.
    #20 203.5 warning: build failed, waiting for other jobs to finish...
    #20 270.4 error: build failed
    
    opened by aglasscage 4
  • Could not convert to geojson::Geometry

    Could not convert to geojson::Geometry

    First of all, thanks for this library.

    I am experimenting an issue converting from geos::Geometry to geojson::Geometry type. It looks like the readme has not been updated since this commit https://github.com/georust/geos/commit/1614a49deedc01b2f0cd4de24852105ba9cabe2f makes use of the std TryFrom trait.

    I have this sample code:

        let pt = "POINT(1.0 1.0)";
        let pt = geos::Geometry::new_from_wkt(pt).unwrap();
    
        let geom: geojson::Geometry = pt.try_into().unwrap();
    

    and the compiler shows this error:

    error[E0277]: the trait bound `Value: From<geos::Geometry<'_>>` is not satisfied
      --> src/main.rs:79:38
       |
    79 |     let geom: geojson::Geometry = pt.try_into().unwrap();
       |                                      ^^^^^^^^ the trait `From<geos::Geometry<'_>>` is not implemented for `Value`
       |
       = note: required because of the requirements on the impl of `Into<Value>` for `geos::Geometry<'_>`
       = note: required because of the requirements on the impl of `From<geos::Geometry<'_>>` for `geojson::Geometry`
       = note: required because of the requirements on the impl of `Into<geojson::Geometry>` for `geos::Geometry<'_>`
       = note: required because of the requirements on the impl of `TryFrom<geos::Geometry<'_>>` for `geojson::Geometry`
       = note: required because of the requirements on the impl of `TryInto<geojson::Geometry>` for `geos::Geometry<'_>`
    

    I have the geos library with json feature enabled.

    [dependencies]
    geos = {version = "7.0.0", features = ["json"]}
    geojson= {version = "0.20.1"}
    

    Curiously, the code compiles by first doing a conversion to geo_types and then to geojson

        let geotypes_obj: geo_types::Geometry<f64> = pt.try_into().unwrap();
        let geometry = geojson::Geometry::new(geojson::Value::from(&geotypes_obj));
    

    I found here https://github.com/georust/geos/blob/0a4862d722b593e7dbb60311e8a58e0e724ae13a/src/enums.rs#L5 that the crate has its own TryFrom trait, but I am not sure if it is related.

    It looks like the geojson::Geometry type has not implemented the TryFrom crate within to_geojson.rs file.

    Let me know your opinion

    opened by JorgeMartinezG 4
  • Implement ContextHandle inside GGeom directly

    Implement ContextHandle inside GGeom directly

    @TeXitoi Does the API looks better this way? If so, we'll have to add a lot more examples in the docs stating that setting GContextHandle inside an object is better than just calling the object.

    opened by GuillaumeGomez 4
  • Try into

    Try into

    This work follows my effort to standardize mimirsbrunn dependencies on a unique version of geo_types (0.6)

    I've noticed the comment // define our own TryInto while the std trait is not stable and felt it was time to move on... So I've removed this comment and the trait definition, and tried to use std::convert::TryFrom instead.

    There is one test that's not working... closed_2_points_linear_ring. I don't understand what needs to be tested, and, from the little I read, it seems the diagram did not match what the code was doing.... So this point (pun intended) needs a bit more work.

    opened by crocme10 3
  • 1.1.0 has breaking changes

    1.1.0 has breaking changes

    Changing the return type of a public function is a breaking change.

    https://github.com/georust/rust-geos/commit/a3065387f1b6936eee8ac32d93b5760c539f985a change a lot of return type from GGeom.

    v1.1.0 must be yanked, and published as 2.0.0.

    opened by TeXitoi 3
  • Return a GeosResult on the various binary predicate methods

    Return a GeosResult on the various binary predicate methods

    This PR wraps the result of the various binary predicates on GGeom and PreparedGGeom in a GeosResult in order to fix #10 .

    I wanted to include a test case but I can't figure out how to trigger such an exception for now.

    It bumps the version number to 1.1.0 as it breaks the API.

    opened by mthh 3
  • PreparedGeometry::contains is not thread safe before run at least once

    PreparedGeometry::contains is not thread safe before run at least once

    Hi,

    It seems that prepared geometry contains is not thread safe before run at least once. Easiest to provoke on large geometries. Not able to provoke on example in docs.

    Regards, Gaute

    opened by gauteh 8
  • try_into() not working: the trait bound `geos::Geometry<'_>: From<&geo_types::MultiPolygon<f64>>` is not satisfied

    try_into() not working: the trait bound `geos::Geometry<'_>: From<&geo_types::MultiPolygon>` is not satisfied

    I must be doing something dumb.

    Rust 2018 edition, Geos v8.0.1

    Code:

    use geo::{MultiPolygon};
    use std::convert::TryInto;
    use geos::{Geometry as GGeometry};
    
    #[derive(Clone, Debug)]
    pub struct GeomAndId {
        pub geom: MultiPolygon<f64>,
        pub id: u128,  // TODO: use core.Id etc.
    }
    
    impl GeomAndId {
        pub fn geos_geom(&self) -> Result<GGeometry<'static>, StringError> {
            let g: GGeometry = (&self.geom).try_into().map_err(|e| {
                format!("Geometry could not be converted to GEOS: {}", e).into()
            })?;
            Ok(g)
        }
    }
    
    

    Error:

    error[E0277]: the trait bound `geos::Geometry<'_>: From<&geo_types::MultiPolygon<f64>>` is not satisfied
      --> geo.rs:20:41
       |
    20 |         let g: GGeometry = (&self.geom).try_into().map_err(|e| {
       |                                         ^^^^^^^^ the trait `From<&geo_types::MultiPolygon<f64>>` is not implemented for `geos::Geometry<'_>`
       |
       = note: required because of the requirements on the impl of `Into<geos::Geometry<'_>>` for `&geo_types::MultiPolygon<f64>`
       = note: required because of the requirements on the impl of `TryFrom<&geo_types::MultiPolygon<f64>>` for `geos::Geometry<'_>`
       = note: required because of the requirements on the impl of `TryInto<geos::Geometry<'_>>` for `&geo_types::MultiPolygon<f64>`
    

    It seems like somehow using try_into() is causing it to want the From trait, but clearly according to docs, the Geos TryFrom<&'a MultiPolygon<f64> trait exists, so what gives? Any help appreciated, thanks.

    opened by velvia 8
  • Adding some documentation

    Adding some documentation

    The self-generated documentation for geos crate is rather empty. Perhaps we should try to document the main structs (CoordSeq, GGeom) and put some examples to feed a bit the documentation.

    opened by mthh 0
Owner
GeoRust
A collection of geospatial tools and libraries written in Rust
GeoRust
Rust bindings for the latest stable release of PROJ

PROJ Coordinate transformation via bindings to the PROJ v7.2.1 API. Two coordinate transformation operations are currently provided: projection (and i

GeoRust 96 Dec 21, 2022
Rust bindings for the latest stable release of PROJ

PROJ Coordinate transformation via bindings to the PROJ v7.2.1 API. Two coordinate transformation operations are currently provided: projection (and i

GeoRust 96 Dec 21, 2022
Rust bindings for GDAL

gdal [] GDAL bindings for Rust. So far, you can: open a raster dataset for reading/writing get size and number of bands get/set projection and geo-tra

GeoRust 208 Dec 27, 2022
High-level netCDF bindings for Rust

netcdf Medium-level netCDF bindings for Rust, allowing easy reading and writing of array-like structures to a file. netCDF can read and write hdf5 fil

GeoRust 54 Dec 18, 2022
Rust crate for performing coordinate transforms

Synopsis A Rust crate use for performing coordinate transformations. The crate relies on nalgebra vectors to perform the coordinate transformations. C

Dave 25 Aug 20, 2022
An fast, offline reverse geocoder (>1,000 HTTP requests per second) in Rust.

Rust Reverse Geocoder A fast reverse geocoder in Rust. Inspired by Python reverse-geocoder. Links Crate 2.0.0 Docs 1.0.1 Docs Description rrgeo takes

Grant Miner 91 Dec 29, 2022
Geospatial primitives and algorithms for Rust

geo Geospatial Primitives, Algorithms, and Utilities The geo crate provides geospatial primitive types such as Point, LineString, and Polygon, and pro

GeoRust 989 Dec 29, 2022
Geohash for Rust

Rust-Geohash Rust-Geohash is a Rust library for Geohash algorithm. Ported from node-geohash module. Documentation Docs Check the API doc at docs.rs Li

GeoRust 74 Sep 8, 2022
Rust read/write support for well-known text (WKT)

wkt Rust read/write support for well-known text (WKT). License Licensed under either of Apache License, Version 2.0 (LICENSE-APACHE or http://www.apac

GeoRust 40 Dec 11, 2022
Google Encoded Polyline encoding & decoding in Rust.

polyline Google Encoded Polyline encoding & decoding in Rust. A Note on Coordinate Order This crate uses Coordinate and LineString types from the geo-

GeoRust 14 Dec 11, 2022
Geocoding library for Rust.

geocoding Rust utilities to enrich addresses, cities, countries, and landmarks with geographic coordinates through third-party geocoding web services.

GeoRust 55 Dec 12, 2022
Rust read/write support for GPS Exchange Format (GPX)

gpx gpx is a library for reading and writing GPX (GPS Exchange Format) files. It uses the primitives provided by geo-types to allow for storage of GPS

GeoRust 63 Dec 5, 2022
Geospatial primitives and algorithms for Rust

geo Geospatial Primitives, Algorithms, and Utilities The geo crate provides geospatial primitive types such as Point, LineString, and Polygon, and pro

GeoRust 990 Jan 1, 2023
Spatial Data Structures for Rust

spade Documentation Using spade Examples Project state Performance License Spade (SPAtial DatastructurEs, obviously!) implements a few nifty data stru

Stefan Altmayer 195 Dec 21, 2022
Rust implementation of the Martinez-Rueda Polygon Clipping Algorithm

Boolean operations on geo shapes This is an implementation of the Martinez-Rueda Polygon Clipping Algorithm in rust to integrate smoothly into the alr

21re 70 Nov 28, 2022
Fast 2D Delaunay triangulation in Rust. A port of Delaunator.

delaunator-rs A very fast static 2D Delaunay triangulation library for Rust. A port of Delaunator. Documentation Example use delaunator::{Point, trian

Vladimir Agafonkin 123 Dec 20, 2022
port of MapBox's earcut triangulation code to Rust language

Earcutr This is a port of the MapBox company's Earcut computer code, which triangulates polygons. Please see https://github.com/mapbox/earcut for more

don bright 41 Dec 26, 2022
Rust read/write support for GPS Exchange Format (GPX)

gpx gpx is a library for reading and writing GPX (GPS Exchange Format) files. It uses the primitives provided by geo-types to allow for storage of GPS

GeoRust 63 Dec 5, 2022
Reading GeoTIFFs in Rust, nothing else!

A TIFF Library for Rust I needed this library to import elevation models for a routing library. As elevation models usually come in GeoTIFF format, bu

GeoRust 29 Dec 14, 2022