Skip to main content

LasHeader

Struct LasHeader 

Source
pub struct LasHeader {
Show 23 fields pub version: LasVersion, pub system_id: [u8; 32], pub generating_software: [u8; 32], pub file_creation_day: u16, pub file_creation_year: u16, pub header_size: u16, pub offset_to_point_data: u32, pub number_of_vlrs: u32, pub point_data_format_id: u8, pub point_data_record_length: u16, pub number_of_point_records: u64, pub scale_x: f64, pub scale_y: f64, pub scale_z: f64, pub offset_x: f64, pub offset_y: f64, pub offset_z: f64, pub max_x: f64, pub min_x: f64, pub max_y: f64, pub min_y: f64, pub max_z: f64, pub min_z: f64,
}
Expand description

Parsed LAS public header block.

Field offsets and sizes are taken from the LAS 1.4 specification.

Fields§

§version: LasVersion

LAS format version.

§system_id: [u8; 32]

System identifier (32 bytes, null-padded ASCII).

§generating_software: [u8; 32]

Generating software string (32 bytes, null-padded ASCII).

§file_creation_day: u16

File creation day-of-year.

§file_creation_year: u16

File creation year.

§header_size: u16

Size of the public header block in bytes.

§offset_to_point_data: u32

Byte offset from the start of the file to point data.

§number_of_vlrs: u32

Number of variable length records.

§point_data_format_id: u8

Point data format ID (0–10).

§point_data_record_length: u16

Size of a single point record in bytes.

§number_of_point_records: u64

Total number of point records in the file.

§scale_x: f64

Scale factor applied to raw X integer coordinates.

§scale_y: f64

Scale factor applied to raw Y integer coordinates.

§scale_z: f64

Scale factor applied to raw Z integer coordinates.

§offset_x: f64

X coordinate offset.

§offset_y: f64

Y coordinate offset.

§offset_z: f64

Z coordinate offset.

§max_x: f64

Maximum X value.

§min_x: f64

Minimum X value.

§max_y: f64

Maximum Y value.

§min_y: f64

Minimum Y value.

§max_z: f64

Maximum Z value.

§min_z: f64

Minimum Z value.

Implementations§

Source§

impl LasHeader

Source

pub fn parse(data: &[u8]) -> Result<Self, CopcError>

Parse a LAS public header from a byte slice.

The slice must contain at least 227 bytes (the LAS 1.0–1.3 header size).

§Errors

Returns CopcError::InvalidFormat when the data is too short or the magic is wrong, and CopcError::UnsupportedVersion for unknown version bytes.

Source

pub fn bounds(&self) -> ([f64; 3], [f64; 3])

Return the bounding box as (min, max) in (X, Y, Z) order.

Trait Implementations§

Source§

impl Clone for LasHeader

Source§

fn clone(&self) -> LasHeader

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for LasHeader

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

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>,

Source§

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.