Struct las::writer::Writer

source ·
pub struct Writer<W: 'static + Write + Seek + Debug + Send> { /* private fields */ }
Expand description

Writes LAS data.

The LAS header needs to be re-written when the writer closes. For convenience, this is done via the Drop implementation of the writer. One consequence is that if the header re-write fails during the drop, a panic will result. If you want to check for errors instead of panicing, use close explicitly.

use std::io::Cursor;
use las::Writer;
{
    let mut writer = Writer::default();
    writer.close().unwrap();
} // <- `close` is not called

Implementations§

Creates a new writer.

The header that is passed in will have various fields zero’d, e.g. bounds, number of points, etc.

Examples
use std::io::Cursor;
use las::Writer;
let writer = Writer::new(Cursor::new(Vec::new()), Default::default());

Close this writer.

Examples
use std::io::Cursor;
use las::Writer;
let mut writer = Writer::default();
writer.close().unwrap();
assert!(writer.close().is_err());

Closes this writer and returns its inner Write, seeked to the beginning of the las data.

Examples
use las::Writer;
let writer = Writer::default();
let cursor = writer.into_inner().unwrap();

Creates a new writer for a path.

If the “laz” feature is enabled, guesses from the extension if the data will be written compressed

Examples
use las::Writer;
let writer = Writer::from_path("/dev/null", Default::default());

Trait Implementations§

Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Executes the destructor for this type. Read more

Returns a reference to this writer’s header.

Writes a point.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.