Trait las::reader::Read[][src]

pub trait Read {
    fn header(&self) -> &Header;
fn read(&mut self) -> Option<Result<Point>>;
fn seek(&mut self, position: u64) -> Result<()>;
fn points(&mut self) -> PointIterator<'_>
Notable traits for PointIterator<'a>
impl<'a> Iterator for PointIterator<'a> type Item = Result<Point>;
; }
Expand description

A trait for objects which read LAS data.

Required methods

Returns a reference to this reader’s header.

Examples
use las::{Read, Reader};
let reader = Reader::from_path("tests/data/autzen.las").unwrap();
let header = reader.header();

Reads a point.

Examples
let mut reader = Reader::from_path("tests/data/autzen.las").unwrap();
let point = reader.read().unwrap().unwrap();

Seeks to the given point number, zero-indexed.

Note that seeking on compressed (LAZ) data can be expensive as the reader will have to seek to the closest chunk start and decompress all points up until the point seeked to.

Examples
use las::{Read, Reader};
let mut reader = Reader::from_path("tests/data/autzen.las").unwrap();
reader.seek(1).unwrap(); // <- seeks to the second point
let the_second_point = reader.read().unwrap().unwrap();

Returns an iterator over this reader’s points.

Examples
let mut reader = Reader::from_path("tests/data/autzen.las").unwrap();
let points = reader.points().collect::<Result<Vec<_>, _>>().unwrap();

Implementors