pub struct GeoJsonStreamWriter {
pub path: String,
/* private fields */
}Expand description
A streaming GeoJSON writer that appends features one at a time.
The output is a valid RFC 7946 FeatureCollection. Unlike [write], which
requires a fully-assembled Layer, GeoJsonStreamWriter writes each
feature directly to disk as it arrives so the caller can release upstream
data structures before calling finish.
CRS note: RFC 7946 requires WGS 84 (EPSG:4326) coordinates. The
streaming writer does not reproject; ensure the input geometries are in the
correct CRS before calling push_feature.
Fields§
§path: StringOutput file path; accessible after consuming the writer via finish.
Implementations§
Source§impl GeoJsonStreamWriter
impl GeoJsonStreamWriter
Sourcepub fn create(path: &str, schema: &Layer) -> Result<Self>
pub fn create(path: &str, schema: &Layer) -> Result<Self>
Create a streaming GeoJSON writer at path.
schema is an empty Layer supplying field definitions.
Sourcepub fn push_feature(
&mut self,
geom: Option<&Geometry>,
attrs: &[FieldValue],
) -> Result<()>
pub fn push_feature( &mut self, geom: Option<&Geometry>, attrs: &[FieldValue], ) -> Result<()>
Append one feature. attrs must be aligned to the full schema provided
to create in schema order.
Auto Trait Implementations§
impl Freeze for GeoJsonStreamWriter
impl RefUnwindSafe for GeoJsonStreamWriter
impl Send for GeoJsonStreamWriter
impl Sync for GeoJsonStreamWriter
impl Unpin for GeoJsonStreamWriter
impl UnsafeUnpin for GeoJsonStreamWriter
impl UnwindSafe for GeoJsonStreamWriter
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> 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