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§
sourcefn property(
&mut self,
idx: usize,
name: &str,
value: &ColumnValue<'_>
) -> Result<bool>
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 columnvalue
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 thename
parameter for matching across rows. - It is not guaranteed that the data type of
name
is consistent across rows. For a givenname
, it may be numeric in one row and string in the next.