Expand description
LAS version.
Defaults to 1.2.
Fields§
§major: u8
The major version.
Should always be 1.
minor: u8
The minor version.
Should be between 0 and 4.
Implementations§
source§impl Version
impl Version
sourcepub fn new(major: u8, minor: u8) -> Version
pub fn new(major: u8, minor: u8) -> Version
Creates a new version.
Doesn’t do any checking that its an actual las version
Examples
use las::Version;
let version = Version::new(1, 2);
sourcepub fn requires_point_data_start_signature(&self) -> bool
pub fn requires_point_data_start_signature(&self) -> bool
Does this version require the point data start signature?
Only 1.0 does.
use las::Version;
assert!(Version::new(1, 0).requires_point_data_start_signature());
assert!(!Version::new(1, 1).requires_point_data_start_signature());
sourcepub fn header_size(&self) -> u16
pub fn header_size(&self) -> u16
Returns this version’s header size.
Examples
use las::Version;
assert_eq!(227, Version::new(1, 2).header_size());
assert_eq!(235, Version::new(1, 3).header_size());
assert_eq!(375, Version::new(1, 4).header_size());
sourcepub fn verify_support_for<F: Feature>(&self) -> Result<()>
pub fn verify_support_for<F: Feature>(&self) -> Result<()>
Checks whether this version supports the feature, returning an error if not.
Examples
use las::Version;
use las::feature::Waveforms;
Version::new(1, 4).verify_support_for::<Waveforms>().unwrap();
assert!(Version::new(1, 2).verify_support_for::<Waveforms>().is_err());
sourcepub fn supports<F: Feature>(&self) -> bool
pub fn supports<F: Feature>(&self) -> bool
Checks whether this version supports the feature.
Examples
use las::Version;
use las::feature::Waveforms;
assert!(Version::new(1, 4).supports::<Waveforms>());
assert!(!Version::new(1, 2).supports::<Waveforms>());
sourcepub fn supports_point_format(&self, format: Format) -> bool
pub fn supports_point_format(&self, format: Format) -> bool
Checks whether this version supports the given point format.
Examples
use las::Version;
use las::point::Format;
let las_1_2 = Version::new(1, 2);
let las_1_4 = Version::new(1, 4);
assert!(las_1_2.supports_point_format(Format::new(3).unwrap()));
assert!(!las_1_2.supports_point_format(Format::new(4).unwrap()));
assert!(las_1_4.supports_point_format(Format::new(4).unwrap()));
Trait Implementations§
source§impl Ord for Version
impl Ord for Version
source§impl PartialOrd<Version> for Version
impl PartialOrd<Version> for Version
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more