Struct pasture_io::las::LASReader

source ·
pub struct LASReader<'a, R: Read + Seek + Send + 'a> { /* private fields */ }
Expand description

PointReader implementation for LAS/LAZ files

Implementations§

source§

impl LASReader<'static, BufReader<File>>

source

pub fn from_path<P: AsRef<Path>>( path: P, point_layout_matches_memory_layout: bool ) -> Result<LASReader<'static, BufReader<File>>>

Creates a new LASReader by opening the file at the given path. Tries to determine whether the file is compressed from the file extension (i.e. files with extension .laz are assumed to be compressed). If point_layout_matches_memory_layout is true, the reader will return point data with a PointLayout that exactly matches the binary layout of the LAS point records. See [point_layout_from_las_point_format] for more information.

Errors

If path does not exist, cannot be opened or does not point to a valid LAS/LAZ file, an error is returned.

source§

impl<'a, R: Read + Seek + Send> LASReader<'a, R>

source

pub fn from_read( read: R, is_compressed: bool, point_layout_matches_memory_layout: bool ) -> Result<Self>

Creates a new LASReader from the given read. This method has to know whether the read points to a compressed LAZ file or a regular LAS file. If point_layout_matches_memory_layout is true, the reader will return point data with a PointLayout that exactly matches the binary layout of the LAS point records. See [point_layout_from_las_point_format] for more information.

Errors

If the given Read does not represent a valid LAS/LAZ file, an error is returned.

source

pub fn remaining_points(&self) -> usize

source

pub fn header(&self) -> &Header

Returns the LAS header for the associated LASReader

source

pub fn las_metadata(&self) -> &LASMetadata

Returns the LAS metadata for the associated LASReader

Trait Implementations§

source§

impl<'a, R: Read + Seek + Send + 'a> PointReader for LASReader<'a, R>

source§

fn get_metadata(&self) -> &dyn Metadata

Returns the Metadata of the associated PointReader
source§

fn get_default_point_layout(&self) -> &PointLayout

Returns the default PointLayout of the associated PointReader
source§

fn read_into<'b, 'c, B: BorrowedMutBuffer<'b>>( &mut self, point_buffer: &'c mut B, count: usize ) -> Result<usize>
where 'b: 'c,

Read count points from this PointReader into the given point_buffer. Uses the PointLayout of the given PointBuffer for reading. If no conversion from the default PointLayout to this new layout are possible, an error is returned. On success, returns the number of points that were read. Overwrites existing data in point_buffer starting at the first point, so the length of point_buffer must be greater than or equal to count
source§

fn read<'a, B: OwningBuffer<'a> + MakeBufferFromLayout<'a> + 'a>( &mut self, count: usize ) -> Result<B>

Reads at most count points from this PointReader into a new buffer of type B. The PointLayout this new buffer will be equal to self.get_default_point_layout
source§

impl<'a, R: Read + Seek + Send + 'a> SeekToPoint for LASReader<'a, R>

source§

fn seek_point(&mut self, position: SeekFrom) -> Result<usize>

Seek to the point at the given position in the underlying stream. Read more
source§

fn point_index(&mut self) -> Result<usize>

Returns the index of the current point in the underlying stream. This is equivalent to calling seek_point(SeekFrom::Current(0)).
source§

fn point_count(&mut self) -> Result<usize>

Returns the total number of points in the underlying stream.

Auto Trait Implementations§

§

impl<'a, R> !RefUnwindSafe for LASReader<'a, R>

§

impl<'a, R> Send for LASReader<'a, R>

§

impl<'a, R> !Sync for LASReader<'a, R>

§

impl<'a, R> Unpin for LASReader<'a, R>
where R: Unpin,

§

impl<'a, R> !UnwindSafe for LASReader<'a, R>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.