Struct las::Reader [] [src]

pub struct Reader<R> {
    pub header: Header,
    // some fields omitted
}

Takes bytes and turns them into points and associated metadata.

Fields

LAS header.

Methods

impl Reader<BufReader<File>>
[src]

Creates a reader for a file at the given path.

Examples

let reader = Reader::from_path("data/1.0_0.las").unwrap();

impl<R: Read + Seek> Reader<R>
[src]

Creates a new reader from a Read object.

While Reader::from_path wraps the underlying File in a BufReader, this method does no such work for you. If you're planning on doing lots of reads, you should probably wrap your Read in a BufReader for performance reasons.

Examples

use std::io::{Cursor, Read};
use std::fs::File;
let mut buf = Vec::new();
File::open("data/1.0_0.las").unwrap().read_to_end(&mut buf).unwrap();
let reader = Reader::new(Cursor::new(buf));

Reads a point.

Examples

let mut reader = Reader::from_path("data/1.0_0.las").unwrap();
// This reader has one point.
let point = reader.read().unwrap().unwrap();
assert!(reader.read().unwrap().is_none());

Creates a vector with all the points in this lasfile.

If any of the reads causes an error, returns that error.

Examples

let mut reader = Reader::from_path("data/1.0_0.las").unwrap();
let points = reader.read_to_end().unwrap();

Returns an iterator over points.

Examples

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

Trait Implementations

impl<R: Debug> Debug for Reader<R>
[src]

Formats the value using the given formatter.