forked from georust/gdal
-
Notifications
You must be signed in to change notification settings - Fork 1
/
mod.rs
42 lines (37 loc) · 1.04 KB
/
mod.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//! GDAL Vector Data
//!
//! ## Reading
//!
//! ```
//! use std::path::Path;
//! use gdal::Dataset;
//!
//! let dataset = Dataset::open(Path::new("fixtures/roads.geojson")).unwrap();
//! let mut layer = dataset.layer(0).unwrap();
//! for feature in layer.features() {
//! let highway_field = feature.field("highway").unwrap().unwrap();
//! let geometry = feature.geometry();
//! println!("{} {}", highway_field.into_string().unwrap(), geometry.wkt().unwrap());
//! }
//! ```
mod defn;
mod feature;
mod gdal_to_geo;
mod geo_to_gdal;
mod geometry;
mod layer;
mod ops;
pub mod sql;
pub use defn::{Defn, Field, FieldIterator};
pub use feature::{Feature, FieldValue, FieldValueIterator};
pub use gdal_sys::{OGRFieldType, OGRwkbGeometryType};
pub use geometry::{geometry_type_to_name, Geometry};
pub use layer::{FeatureIterator, FieldDefn, Layer, LayerCaps};
pub use ops::GeometryIntersection;
use crate::errors::Result;
/// Convert object to a GDAL geometry.
pub trait ToGdal {
fn to_gdal(&self) -> Result<Geometry>;
}
#[cfg(test)]
mod vector_tests;