Trait geozero::PropertyProcessor

source ·
pub trait PropertyProcessor {
    // Provided method
    fn property(
        &mut self,
        idx: usize,
        name: &str,
        value: &ColumnValue<'_>
    ) -> Result<bool> { ... }
}
Expand description

Feature property processing trait.

§Usage example:

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!("column idx: {i} name: {n} value: {v:?}");
        Ok(false) // don't abort
    }
}

Provided Methods§

source

fn property( &mut self, idx: usize, name: &str, value: &ColumnValue<'_> ) -> Result<bool>

Process property value. Abort processing, if return value is true.

  • idx: the positional index of the property.
  • name is the name of the column
  • value is the value of this field
§Notes:
  • It is not guaranteed that idx is consistent across rows, nor is it guaranteed that the set of names in each row is the same. Some input formats, like GeoJSON, are schema-less and properties may change in every row. For this reason, it is suggested to use the name parameter for matching across rows.
  • It is not guaranteed that the data type of name is consistent across rows. For a given name, it may be numeric in one row and string in the next.

Implementations on Foreign Types§

source§

impl<S: BuildHasher> PropertyProcessor for HashMap<String, String, S>

source§

fn property( &mut self, _idx: usize, colname: &str, colval: &ColumnValue<'_> ) -> Result<bool>

Implementors§