[][src]Crate geozero

Zero-Copy reading and writing of geospatial data.

GeoZero defines an API for reading geospatial data formats without an intermediate representation. It defines traits which can be implemented to read and convert to an arbitrary format or render geometries directly.

Supported geometry types:

Supported dimensions: X, Y, Z, M, T

Installation

[dependencies]
geozero = "0.2"

Zero-copy geometry reader

Geometries can be accessed by implementing the GeomProcessor trait.

use geozero::{GeomProcessor, error::Result};

struct CoordPrinter;

impl GeomProcessor for CoordPrinter {
    fn xy(&mut self, x: f64, y: f64, _idx: usize) -> Result<()> {
        Ok(println!("({} {})", x, y))
    }
}

Zero-copy feature access

Properties can be accessed by implementing the PropertyProcessor trait.

use geozero::{PropertyProcessor, ColumnValue, error::Result};

struct PropertyPrinter;

impl PropertyProcessor for PropertyPrinter {
    fn property(&mut self, i: usize, n: &str, v: &ColumnValue) -> Result<bool> {
        println!("columnidx: {} name: {} value: {:?}", i, n, v);
        Ok(false) // don't abort
    }
}

Modules

error

Structs

CoordDimensions

Dimensions requested for processing

CreateOpts
Extent
Multiplexer
OpenOpts
ProcessorSink

Empty processor implementation

SelectOpts

Enums

ColumnValue

Traits

Driver
FeatureProcessor

Feature processing trait

GeomProcessor

Geometry processing trait

HttpReader
PropertyProcessor

Feature property processing trait

ReadSeek
Reader
Writer