pub struct BlobFilter { /* private fields */ }Expand description
Filter for skipping blobs by element type during pipelined reads.
When a BlobFilter is set on an ElementReader,
the pipeline skips decompressing blobs whose element type (from indexdata)
does not match the filter. Files without indexdata are unaffected - all
blobs pass through.
§Example
use pbfhogg::{ElementReader, BlobFilter};
let reader = ElementReader::from_path("data.osm.pbf")?;
let reader = reader.with_blob_filter(BlobFilter::only_ways());
// Only way blobs are decompressed; node and relation blobs are skipped.Implementations§
Source§impl BlobFilter
impl BlobFilter
Sourcepub fn new(want_nodes: bool, want_ways: bool, want_relations: bool) -> Self
pub fn new(want_nodes: bool, want_ways: bool, want_relations: bool) -> Self
Create a filter that accepts only the specified element types.
Sourcepub fn only_nodes() -> Self
pub fn only_nodes() -> Self
Filter that accepts only node blobs.
Sourcepub fn only_relations() -> Self
pub fn only_relations() -> Self
Filter that accepts only relation blobs.
Sourcepub fn with_node_bbox(self, bbox: BlobBbox) -> Self
pub fn with_node_bbox(self, bbox: BlobBbox) -> Self
Add a spatial bbox filter for node blobs. Node blobs whose coordinate bbox does not intersect the given bbox are skipped (no decompression).
Only effective on files with v2 indexdata. Blobs without spatial indexdata always pass through (conservative).
Sourcepub fn with_required_tag_keys(self, keys: Vec<String>) -> Self
pub fn with_required_tag_keys(self, keys: Vec<String>) -> Self
Add required tag keys for blob-level tag filtering.
Blobs whose tag index contains none of these keys are skipped. Only effective on files with tag index data (BlobHeader field 4). Blobs without tag data always pass through (conservative).
Sourcepub fn with_required_tag_prefixes(self, prefixes: Vec<String>) -> Self
pub fn with_required_tag_prefixes(self, prefixes: Vec<String>) -> Self
Add required tag key prefixes for blob-level tag filtering.
Blobs whose tag index contains no key starting with any of these
prefixes are skipped (e.g. addr: matches addr:city, addr:street).
Trait Implementations§
Source§impl Clone for BlobFilter
impl Clone for BlobFilter
Source§fn clone(&self) -> BlobFilter
fn clone(&self) -> BlobFilter
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for BlobFilter
impl RefUnwindSafe for BlobFilter
impl Send for BlobFilter
impl Sync for BlobFilter
impl Unpin for BlobFilter
impl UnsafeUnpin for BlobFilter
impl UnwindSafe for BlobFilter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more