Struct las::header::Header
[−]
[src]
pub struct Header { pub file_signature: [u8; 4], pub file_source_id: u16, pub global_encoding: u16, pub guid_data_1: u32, pub guid_data_2: u16, pub guid_data_3: u16, pub guid_data_4: [u8; 8], pub version_major: u8, pub version_minor: u8, pub system_identifier: [u8; 32], pub generating_software: [u8; 32], pub file_creation_day_of_year: u16, pub file_creation_year: u16, pub header_size: u16, pub offset_to_point_data: u32, pub number_of_variable_length_records: u32, pub point_data_format: PointDataFormat, pub point_data_record_length: u16, pub number_of_point_records: u32, pub number_of_points_by_return: [u32; 5], pub x_scale_factor: f64, pub y_scale_factor: f64, pub z_scale_factor: f64, pub x_offset: f64, pub y_offset: f64, pub z_offset: f64, pub x_max: f64, pub x_min: f64, pub y_max: f64, pub y_min: f64, pub z_max: f64, pub z_min: f64, }
A las header.
Fields
file_signature | The las file signature. Should always be "LASF". |
file_source_id | A numeric identifier for this file. |
global_encoding | Unused in early version, and exapanded to help with GPS time offsets in later versions. |
guid_data_1 | The first of four parts of the project id. |
guid_data_2 | The second of four parts of the project id. |
guid_data_3 | The third of four parts of the project id. |
guid_data_4 | The fourth of four parts of the project id. |
version_major | The las major version. Should always be 1. |
version_minor | The las minor version. |
system_identifier | Generally the hardware system that created the las file. Can also be the algorithm that produced the lasfile. This field is poorly defined. |
generating_software | The software the generated the las file. |
file_creation_day_of_year | The day of the year, indexed to 1. |
file_creation_year | The year of file creation. |
header_size | The size of the las header. Softwares are technically allowed to add custom extensions to the las header, which would then affect this header size, but that is discouraged as such support is not universal. |
offset_to_point_data | The byte offset to the beginning of point data. Includes the size of the header and the variable length records. |
number_of_variable_length_records | The number of variable length records. |
point_data_format | The point data format. |
point_data_record_length | The length of one point data record, in bytes. |
number_of_point_records | The total number of point records. |
number_of_points_by_return | The number of point records of each return number. This only supports five returns per pulse. |
x_scale_factor | The x scale factor for each point. |
y_scale_factor | The y scale factor for each point. |
z_scale_factor | The z scale factor for each point. |
x_offset | The x offset for each point. |
y_offset | The y offset for each point. |
z_offset | The z offset for each point. |
x_max | The maximum x value. |
x_min | The minimum x value. |
y_max | The maximum y value. |
y_min | The minimum y value. |
z_max | The maximum z value. |
z_min | The minimum z value. |
Methods
impl Header
fn read_from<R: Read>(reader: &mut R) -> Result<Header>
Reads a header from a Read
.
Examples
use std::fs::File; use las::header::Header; let ref mut file = File::open("data/1.0_0.las").unwrap(); let header = Header::read_from(file);
fn new() -> Header
fn write_to<W: Write>(&self, writer: &mut W) -> Result<u16>
Writes this header to a Write
.
Returns the number of bytes written.
Examples
use std::io::Cursor; use las::header::Header; let header = Header::new(); let ref mut writer = Cursor::new(Vec::new()); let bytes_written = header.write_to(writer).unwrap();
fn calculate_size(&mut self)
Calculates the size of this header and assigns it to the header structure.
Examples
use las::header::Header; let mut header = Header::new(); header.calculate_size(); assert_eq!(227, header.header_size);