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>;
; }

A trait for objects which read LAS data.

Required methods

fn header(&self) -> &Header[src]

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();

fn read(&mut self) -> Option<Result<Point>>[src]

Reads a point.

Examples

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

fn seek(&mut self, position: u64) -> Result<()>[src]

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();

fn points(&mut self) -> PointIterator<'_>

Notable traits for PointIterator<'a>

impl<'a> Iterator for PointIterator<'a> type Item = Result<Point>;
[src]

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();
Loading content...

Implementors

impl Read for Reader[src]

fn header(&self) -> &Header[src]

Returns a reference to this reader's header.

fn read(&mut self) -> Option<Result<Point>>[src]

Reads a point.

fn seek(&mut self, position: u64) -> Result<()>[src]

Seeks to the given point number, zero-indexed.

fn points(&mut self) -> PointIterator<'_>

Notable traits for PointIterator<'a>

impl<'a> Iterator for PointIterator<'a> type Item = Result<Point>;
[src]

Returns an iterator over this reader's points.

Loading content...