#geolocation #geolib #geofence

geoutils

A collection of geo computation utilities

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

#13 in Geospatial

Download history 3767/week @ 2022-12-01 3593/week @ 2022-12-08 3999/week @ 2022-12-15 2229/week @ 2022-12-22 2910/week @ 2022-12-29 3784/week @ 2023-01-05 3400/week @ 2023-01-12 3547/week @ 2023-01-19 3452/week @ 2023-01-26 3221/week @ 2023-02-02 3066/week @ 2023-02-09 3765/week @ 2023-02-16 3708/week @ 2023-02-23 4524/week @ 2023-03-02 4751/week @ 2023-03-09 4602/week @ 2023-03-16

18,232 downloads per month
Used in 2 crates

Apache-2.0

15KB
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

~220KB