geo
geoutils
cargo install geoutils
geo

geoutils

Geological computations and utilities for Rust applications

by Srishan

0.5.0 (see all)License:Apache-2.0
cargo install geoutils
Readme

Build Status Documentation

geoutils

Geoutils is a evolving crate to provide several geological computations and utilities. Most computations are based off methods on the Location struct.

Find the full API reference at docs.rs.

Examples

use geoutils::Location;


let berlin = Location::new(52.518611, 13.408056);
let moscow = Location::new(55.751667, 37.617778);
let distance = berlin.distance_to(&moscow).unwrap();




println!("Distance = {}", distance.meters());

println!("Distance = {}", distance.meters());

use geoutils::Location;


let berlin = Location::new(52.518611, 13.408056);
let moscow = Location::new(55.751667, 37.617778);
let distance = berlin.haversine_distance_to(&moscow);




println!("Distance = {}", distance.meters());

println!("Distance = {}", distance.meters());

  • Get the center of a list of coordinates.
use geoutils::Location;


let berlin = Location::new(52.518611, 13.408056);
let moscow = Location::new(55.751667, 37.617778);
let center = Location::center(&vec![&berlin, &moscow]);




println!("Center {}, {}", center.latitude(), center.longitude());

println!("Center {}, {}", center.latitude(), center.longitude());

  • Check if a point falls in a certain radius of another point.
use geoutils::{Location, Distance};


let berlin = Location::new(52.518611, 13.408056);
let moscow = Location::new(55.751667, 37.617778);
let is_in_radius = berlin.is_in_circle(&moscow, Distance::from_meters(2000.0)).unwrap();




println!("Is Berlin in 2000m of Moscow? {}", is_in_radius);

println!("Is Berlin in 2000m of Moscow? {}", is_in_radius);

License

Apache-2.0

GitHub Stars

16

LAST COMMIT

15d ago

MAINTAINERS

1

CONTRIBUTORS

4

OPEN ISSUES

0

OPEN PRs

0
VersionTagPublished
0.5.0
15d ago
0.4.1
1yr ago
0.4.0
2yrs ago
0.3.0
2yrs ago
No alternatives found
No tutorials found
Add a tutorial