Trait geozero::GeomProcessor[][src]

pub trait GeomProcessor {
    fn dimensions(&self) -> CoordDimensions { ... }
fn multi_dim(&self) -> bool { ... }
fn srid(&mut self, srid: Option<i32>) -> Result<()> { ... }
fn xy(&mut self, x: f64, y: f64, idx: usize) -> Result<()> { ... }
fn coordinate(
        &mut self,
        x: f64,
        y: f64,
        z: Option<f64>,
        m: Option<f64>,
        t: Option<f64>,
        tm: Option<u64>,
        idx: usize
    ) -> Result<()> { ... }
fn point_begin(&mut self, idx: usize) -> Result<()> { ... }
fn point_end(&mut self, idx: usize) -> Result<()> { ... }
fn multipoint_begin(&mut self, size: usize, idx: usize) -> Result<()> { ... }
fn multipoint_end(&mut self, idx: usize) -> Result<()> { ... }
fn linestring_begin(
        &mut self,
        tagged: bool,
        size: usize,
        idx: usize
    ) -> Result<()> { ... }
fn linestring_end(&mut self, tagged: bool, idx: usize) -> Result<()> { ... }
fn multilinestring_begin(&mut self, size: usize, idx: usize) -> Result<()> { ... }
fn multilinestring_end(&mut self, idx: usize) -> Result<()> { ... }
fn polygon_begin(
        &mut self,
        tagged: bool,
        size: usize,
        idx: usize
    ) -> Result<()> { ... }
fn polygon_end(&mut self, tagged: bool, idx: usize) -> Result<()> { ... }
fn multipolygon_begin(&mut self, size: usize, idx: usize) -> Result<()> { ... }
fn multipolygon_end(&mut self, idx: usize) -> Result<()> { ... }
fn geometrycollection_begin(
        &mut self,
        size: usize,
        idx: usize
    ) -> Result<()> { ... }
fn geometrycollection_end(&mut self, idx: usize) -> Result<()> { ... }
fn circularstring_begin(&mut self, size: usize, idx: usize) -> Result<()> { ... }
fn circularstring_end(&mut self, idx: usize) -> Result<()> { ... }
fn compoundcurve_begin(&mut self, size: usize, idx: usize) -> Result<()> { ... }
fn compoundcurve_end(&mut self, idx: usize) -> Result<()> { ... }
fn curvepolygon_begin(&mut self, size: usize, idx: usize) -> Result<()> { ... }
fn curvepolygon_end(&mut self, idx: usize) -> Result<()> { ... }
fn multicurve_begin(&mut self, size: usize, idx: usize) -> Result<()> { ... }
fn multicurve_end(&mut self, idx: usize) -> Result<()> { ... }
fn multisurface_begin(&mut self, size: usize, idx: usize) -> Result<()> { ... }
fn multisurface_end(&mut self, idx: usize) -> Result<()> { ... }
fn triangle_begin(
        &mut self,
        tagged: bool,
        size: usize,
        idx: usize
    ) -> Result<()> { ... }
fn triangle_end(&mut self, tagged: bool, idx: usize) -> Result<()> { ... }
fn polyhedralsurface_begin(&mut self, size: usize, idx: usize) -> Result<()> { ... }
fn polyhedralsurface_end(&mut self, idx: usize) -> Result<()> { ... }
fn tin_begin(&mut self, size: usize, idx: usize) -> Result<()> { ... }
fn tin_end(&mut self, idx: usize) -> Result<()> { ... } }

Geometry processing trait

Usage example:

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))
    }
}

Provided methods

fn dimensions(&self) -> CoordDimensions[src]

Additional dimensions requested when processing coordinates

fn multi_dim(&self) -> bool[src]

Request additional dimensions for coordinate processing

fn srid(&mut self, srid: Option<i32>) -> Result<()>[src]

SRID of geometries

Emitted before geometry begin

fn xy(&mut self, x: f64, y: f64, idx: usize) -> Result<()>[src]

Process coordinate with x,y dimensions

fn coordinate(
    &mut self,
    x: f64,
    y: f64,
    z: Option<f64>,
    m: Option<f64>,
    t: Option<f64>,
    tm: Option<u64>,
    idx: usize
) -> Result<()>
[src]

Process coordinate with all requested dimensions

fn point_begin(&mut self, idx: usize) -> Result<()>[src]

Begin of Point processing

Next: xy/coordinate

fn point_end(&mut self, idx: usize) -> Result<()>[src]

End of Point processing

fn multipoint_begin(&mut self, size: usize, idx: usize) -> Result<()>[src]

Begin of MultiPoint processing

Next: size * xy/coordinate

fn multipoint_end(&mut self, idx: usize) -> Result<()>[src]

End of MultiPoint processing

fn linestring_begin(
    &mut self,
    tagged: bool,
    size: usize,
    idx: usize
) -> Result<()>
[src]

Begin of LineString processing

An untagged LineString is either a Polygon ring or part of a MultiLineString

Next: size * xy/coordinate

fn linestring_end(&mut self, tagged: bool, idx: usize) -> Result<()>[src]

End of LineString processing

fn multilinestring_begin(&mut self, size: usize, idx: usize) -> Result<()>[src]

Begin of MultiLineString processing

Next: size * LineString (untagged)

fn multilinestring_end(&mut self, idx: usize) -> Result<()>[src]

End of MultiLineString processing

fn polygon_begin(&mut self, tagged: bool, size: usize, idx: usize) -> Result<()>[src]

Begin of Polygon processing

An untagged Polygon is part of a MultiPolygon

Next: size * LineString (untagged) = rings

fn polygon_end(&mut self, tagged: bool, idx: usize) -> Result<()>[src]

End of Polygon processing

fn multipolygon_begin(&mut self, size: usize, idx: usize) -> Result<()>[src]

Begin of MultiPolygon processing

Next: size * Polygon (untagged)

fn multipolygon_end(&mut self, idx: usize) -> Result<()>[src]

End of MultiPolygon processing

fn geometrycollection_begin(&mut self, size: usize, idx: usize) -> Result<()>[src]

Begin of GeometryCollection processing

fn geometrycollection_end(&mut self, idx: usize) -> Result<()>[src]

End of GeometryCollection processing

fn circularstring_begin(&mut self, size: usize, idx: usize) -> Result<()>[src]

Begin of CircularString processing

The CircularString is the basic curve type, similar to a LineString in the linear world. A single segment required three points, the start and end points (first and third) and any other point on the arc. The exception to this is for a closed circle, where the start and end points are the same. In this case the second point MUST be the center of the arc, ie the opposite side of the circle. To chain arcs together, the last point of the previous arc becomes the first point of the next arc, just like in LineString. This means that a valid circular string must have an odd number of points greated than 1.

Next: size * xy/coordinate

fn circularstring_end(&mut self, idx: usize) -> Result<()>[src]

End of CircularString processing

fn compoundcurve_begin(&mut self, size: usize, idx: usize) -> Result<()>[src]

Begin of CompoundCurve processing

A compound curve is a single, continuous curve that has both curved (circular) segments and linear segments. That means that in addition to having well-formed components, the end point of every component (except the last) must be coincident with the start point of the following component.

Next: size * (CircularString | LineString (untagged))

fn compoundcurve_end(&mut self, idx: usize) -> Result<()>[src]

End of CompoundCurve processing

fn curvepolygon_begin(&mut self, size: usize, idx: usize) -> Result<()>[src]

Begin of CurvePolygon processing

A CurvePolygon is just like a polygon, with an outer ring and zero or more inner rings. The difference is that a ring can take the form of a circular string, linear string or compound string.

Next: size * (CircularString | LineString (untagged) | CompoundCurve)

fn curvepolygon_end(&mut self, idx: usize) -> Result<()>[src]

End of CurvePolygon processing

fn multicurve_begin(&mut self, size: usize, idx: usize) -> Result<()>[src]

Begin of MultiCurve processing

The MultiCurve is a collection of curves, which can include linear strings, circular strings or compound strings.

Next: size * (CircularString | LineString (untagged) | CompoundCurve)

fn multicurve_end(&mut self, idx: usize) -> Result<()>[src]

End of MultiCurve processing

fn multisurface_begin(&mut self, size: usize, idx: usize) -> Result<()>[src]

Begin of MultiSurface processing

The MultiSurface is a collection of surfaces, which can be (linear) polygons or curve polygons.

Next: size * (CurvePolygon | Polygon (untagged))

fn multisurface_end(&mut self, idx: usize) -> Result<()>[src]

End of MultiSurface processing

fn triangle_begin(
    &mut self,
    tagged: bool,
    size: usize,
    idx: usize
) -> Result<()>
[src]

Begin of Triangle processing

An untagged Triangle is part of a Tin

Next: size * LineString (untagged) = rings

fn triangle_end(&mut self, tagged: bool, idx: usize) -> Result<()>[src]

End of Polygon processing

fn polyhedralsurface_begin(&mut self, size: usize, idx: usize) -> Result<()>[src]

Begin of PolyhedralSurface processing

Next: size * Polygon (untagged)

fn polyhedralsurface_end(&mut self, idx: usize) -> Result<()>[src]

End of MultiPolygon processing

fn tin_begin(&mut self, size: usize, idx: usize) -> Result<()>[src]

Begin of Tin processing

Next: size * Polygon (untagged)

fn tin_end(&mut self, idx: usize) -> Result<()>[src]

End of MultiPolygon processing

Loading content...

Implementors

impl GeomProcessor for GeoWriter[src]

impl GeomProcessor for GeosWriter<'_>[src]

impl GeomProcessor for ProcessorSink[src]

impl<W: Write> GeomProcessor for GeoJsonWriter<'_, W>[src]

impl<W: Write> GeomProcessor for SvgWriter<'_, W>[src]

impl<W: Write> GeomProcessor for WkbWriter<'_, W>[src]

impl<W: Write> GeomProcessor for WktWriter<'_, W>[src]

Loading content...