geo 0.23.1

Geospatial primitives and algorithms
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
#[macro_use]
extern crate geo;

use geo::Centroid;

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