7 releases (4 breaking)

0.5.1 Aug 7, 2022
0.5.0 Jun 10, 2022
0.4.1 Apr 5, 2021
0.4.0 Mar 19, 2020
0.1.0 Dec 1, 2018

#88 in Geospatial

Download history 5683/week @ 2024-11-23 7157/week @ 2024-11-30 6185/week @ 2024-12-07 6130/week @ 2024-12-14 2859/week @ 2024-12-21 4057/week @ 2024-12-28 7403/week @ 2025-01-04 7546/week @ 2025-01-11 8115/week @ 2025-01-18 8135/week @ 2025-01-25 7579/week @ 2025-02-01 7592/week @ 2025-02-08 7820/week @ 2025-02-15 9197/week @ 2025-02-22 8383/week @ 2025-03-01 6471/week @ 2025-03-08

32,993 downloads per month
Used in 3 crates

Apache-2.0

16KB
230 lines

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());
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());
  • 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());
  • 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);

License

Apache-2.0

Dependencies

~155KB