pub struct Vlr {
pub user_id: String,
pub record_id: u16,
pub description: String,
pub data: Vec<u8>,
}Expand description
A variable length record.
Fields§
§user_id: StringThe user that created this record.
This value is often an official, “registered” user_id, such as “LASF_Spec” or “LASF_Projection”.
record_id: u16This value specifies the type of record, and depends on the user id.
description: StringTextual description of these data.
data: Vec<u8>The data themselves.
Implementations§
Source§impl Vlr
impl Vlr
Sourcepub fn new(raw_vlr: Vlr) -> Vlr
pub fn new(raw_vlr: Vlr) -> Vlr
Creates a vlr from a raw vlr.
§Examples
use las::{Vlr, raw};
let raw_vlr = raw::Vlr::default();
let vlr = Vlr::new(raw_vlr);Sourcepub fn into_raw(self, is_extended: bool) -> Result<Vlr>
pub fn into_raw(self, is_extended: bool) -> Result<Vlr>
Converts this vlr to a raw vlr.
§Examples
use las::Vlr;
let raw_vlr = Vlr::default().into_raw(false).unwrap();
let raw_evlr = Vlr::default().into_raw(true).unwrap();Sourcepub fn len(&self, is_extended: bool) -> usize
pub fn len(&self, is_extended: bool) -> usize
Returns the total length of this vlr, header and data.
§Examples
use las::Vlr;
let mut vlr = Vlr::default();
assert_eq!(54, vlr.len(false));
assert_eq!(60, vlr.len(true));
vlr.data = vec![0];
assert_eq!(55, vlr.len(false));Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true if the data of this vlr is empty.
§Examples
use las::Vlr;
let mut vlr = Vlr::default();
assert!(vlr.is_empty());
vlr.data = vec![42];
assert!(!vlr.is_empty());Sourcepub fn has_large_data(&self) -> bool
pub fn has_large_data(&self) -> bool
Returns true if this vlr must be extended due to large data size.
§Examples
use las::Vlr;
use std::u16;
let mut vlr = Vlr::default();
assert!(!vlr.has_large_data());
vlr.data = vec![0; u16::MAX as usize + 1 ];
assert!(vlr.has_large_data());Sourcepub fn is_crs(&self) -> bool
pub fn is_crs(&self) -> bool
Check if the vlr is a projection (coordinate reference system) VLR
§Examples
use las::Vlr;
let mut vlr = Vlr::default();
vlr.user_id = "LASF_Projection".to_string();
vlr.record_id = 2112;
assert!(vlr.is_crs());Sourcepub fn is_wkt_crs(&self) -> bool
pub fn is_wkt_crs(&self) -> bool
Returns true if it’s a well-known WKT coordinate reference system VLR.
§Examples
use las::Vlr;
let mut vlr = Vlr::default();
vlr.user_id = "LASF_Projection".to_string();
vlr.record_id = 2112;
assert!(vlr.is_wkt_crs());Sourcepub fn is_geotiff_crs(&self) -> bool
pub fn is_geotiff_crs(&self) -> bool
Returns true if it’s a geotiff coordinate reference system VLR.
§Examples
use las::Vlr;
let mut vlr = Vlr::default();
vlr.user_id = "LASF_Projection".to_string();
vlr.record_id = 34735;
assert!(vlr.is_geotiff_crs());Trait Implementations§
Source§impl TryFrom<&Vlr> for CopcInfoVlr
impl TryFrom<&Vlr> for CopcInfoVlr
impl StructuralPartialEq for Vlr
Auto Trait Implementations§
impl Freeze for Vlr
impl RefUnwindSafe for Vlr
impl Send for Vlr
impl Sync for Vlr
impl Unpin for Vlr
impl UnwindSafe for Vlr
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