geo 0.33.1

Geospatial primitives and algorithms
Documentation
1
2
3
4
5
6
7
8
9
use geo::{Centroid, line_string};

fn main() {
    let linestring = geo::line_string![
        (x: 40.02f64, y: 116.34),
        (x: 41.02f64, y: 116.34),
    ];
    println!("Centroid {:?}", linestring.centroid());
}