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§
source§impl<W: 'static + Write + Seek + Debug + Send> Writer<W>
impl<W: 'static + Write + Seek + Debug + Send> Writer<W>
source§impl<W: 'static + Write + Seek + Debug + Send> Writer<W>
impl<W: 'static + Write + Seek + Debug + Send> Writer<W>
sourcepub fn into_inner(self) -> Result<W>
pub fn into_inner(self) -> Result<W>
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();
source§impl Writer<BufWriter<File>>
impl Writer<BufWriter<File>>
sourcepub fn from_path<P: AsRef<Path>>(
path: P,
header: Header
) -> Result<Writer<BufWriter<File>>>
pub fn from_path<P: AsRef<Path>>(
path: P,
header: Header
) -> Result<Writer<BufWriter<File>>>
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());