Struct las::stream::Stream [] [src]

pub struct Stream<R: Read> {
    // some fields omitted
}

A stream of las points.

Methods

impl Stream<BufReader<File>>

fn from_path<P: AsRef<Path>>(path: P) -> Result<Stream<BufReader<File>>>

Opens a new stream for the given path.

Examples

use las::stream::Stream;
let stream = Stream::from_path("data/1.0_0.las").unwrap();

impl<R: Read + Seek> Stream<R>

fn new(reader: R) -> Result<Stream<R>>

Creates a new stream for a given Read object, consuming the read.

Examples

use std::fs::File;
use las::stream::Stream;
let file = File::open("data/1.0_0.las").unwrap();
let stream = Stream::new(file);

fn next_point(&mut self) -> Result<Option<Point>>

Returns the next point in this stream.

Examples

use las::stream::Stream;
let mut stream = Stream::from_path("data/1.0_0.las").unwrap();
let point = stream.next_point().unwrap();
assert!(point.is_some());
let point = stream.next_point().unwrap();
assert!(point.is_none());

impl<R: Read> Stream<R>

fn header(&self) -> Header

Returns this stream's las header.

Examples

use las::stream::Stream;
let stream = Stream::from_path("data/1.0_0.las").unwrap();
let header = stream.header();

fn vlrs(&self) -> &Vec<Vlr>

Returns a reference to this stream's vlrs.

Examples

use las::stream::Stream;
let stream = Stream::from_path("data/1.0_0.las").unwrap();
let vlrs = stream.vlrs();

fn npoints(&self) -> u32

Returns the number of points in this lasfile, as specified by the header.

Examples

use las::stream::Stream;
let stream = Stream::from_path("data/1.0_0.las").unwrap();
assert_eq!(1, stream.npoints());

fn eof(&self) -> bool

Returns true if this stream is at the end of the file.

Examples

use las::stream::Stream;
let mut stream = Stream::from_path("data/1.0_0.las").unwrap();
assert!(!stream.eof());
let _ = stream.next_point().unwrap();
assert!(stream.eof());

Trait Implementations

Derived Implementations

impl<R: Debug + Read> Debug for Stream<R>

fn fmt(&self, __arg_0: &mut Formatter) -> Result