pub struct LASReader<T: Reader> {
pub header: LASHeader,
pub variable_length_records: BTreeMap<u32, LASExtendedVariableLengthRecord>,
pub wkt: Option<String>,
pub geo_key_directory: GeoStore,
/* private fields */
}Expand description
§LAS Reader
§Description
Reads LAS data. Supports up to the LAS 1.4 specification. See specification
Implements the FeatureReader trait
Data is stored like so:
| PUBLIC HEADER BLOCK |
| VARIABLE LENGTH RECORDS |
| POINT DATA RECORDS |§Usage
The methods you have access to:
LASReader::new: Create a new LASReaderLASReader::len: Get the number of points storedLASReader::is_empty: Check if the reader is emptyLASReader::get_feature: Reads a point in at index as a featureLASReader::get_point: Reads a point in at indexLASReader::iter: Create an iterator to collect the featuresLASReader::par_iter: Create a parallel iterator to collect the features
use gistools::{parsers::{FeatureReader, FileReader}, readers::LASReader};
use std::path::PathBuf;
let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
path.push("tests/readers/las/fixtures/simple1_1.las");
let las_reader = LASReader::new(FileReader::from(path.clone()), None);
let features = las_reader.iter().collect::<Vec<_>>();
assert_eq!(features.len(), 1_065);§Links
- https://www.usgs.gov/ngp-standards-and-specifications/lidar-base-specification-online
- https://www.asprs.org/wp-content/uploads/2010/12/LAS_1_4_r13.pdf
- https://liblas.org/development/index.html
- https://downloads.rapidlasso.de/doc/LAZ_Specification_1.4_R1.pdf
- https://github.com/PDAL/PDAL
- https://github.com/libLAS/libLAS (deprecated for PDAL)
- https://github.com/LASzip
Fields§
§header: LASHeaderPublic Header Block
variable_length_records: BTreeMap<u32, LASExtendedVariableLengthRecord>Extended VARIABLE LENGTH RECORDS
wkt: Option<String>WKT projection string
geo_key_directory: GeoStoreGeoKeyDirectory
Implementations§
Source§impl<T: Reader> LASReader<T>
impl<T: Reader> LASReader<T>
Sourcepub fn new(reader: T, options: Option<LASReaderOptions>) -> Self
pub fn new(reader: T, options: Option<LASReaderOptions>) -> Self
Create a new LASReader
Sourcepub fn get_feature(&self, index: u64) -> Option<LASVectorFeature>
pub fn get_feature(&self, index: u64) -> Option<LASVectorFeature>
Reads a point in at index as a feature
Trait Implementations§
Source§impl<T: Reader> FeatureReader<(), Map<String, ValueType>, LASPoint> for LASReader<T>
A feature reader trait with a callback-based approach
impl<T: Reader> FeatureReader<(), Map<String, ValueType>, LASPoint> for LASReader<T>
A feature reader trait with a callback-based approach
Source§type FeatureIterator<'a> = LASIterator<'a, T>
where
T: 'a
type FeatureIterator<'a> = LASIterator<'a, T> where T: 'a
The Feature Reader should implement an iterator of some kind
Source§fn iter(&self) -> Self::FeatureIterator<'_>
fn iter(&self) -> Self::FeatureIterator<'_>
All readers have an iter function that returns a Iterator struct
Auto Trait Implementations§
impl<T> Freeze for LASReader<T>where
T: Freeze,
impl<T> !RefUnwindSafe for LASReader<T>
impl<T> !Send for LASReader<T>
impl<T> !Sync for LASReader<T>
impl<T> Unpin for LASReader<T>where
T: Unpin,
impl<T> !UnwindSafe for LASReader<T>
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more