Vlr

Struct Vlr 

Source
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: String

The user that created this record.

This value is often an official, “registered” user_id, such as “LASF_Spec” or “LASF_Projection”.

§record_id: u16

This value specifies the type of record, and depends on the user id.

§description: String

Textual description of these data.

§data: Vec<u8>

The data themselves.

Implementations§

Source§

impl Vlr

Source

pub fn is_copc_info(&self) -> bool

Returns true if this Vlr is the Copc info Vlr.

§Examples
use las::Vlr;

let mut vlr = Vlr::default();
assert!(!vlr.is_copc_info());
vlr.user_id = "copc".to_string();
vlr.record_id = 1;
assert!(&vlr.is_copc_info());
Source§

impl Vlr

Source

pub fn is_copc_hierarchy(&self) -> bool

Returns true if this Vlr is the Copc Hierarchy Vlr.

§Examples
use las::Vlr;

let mut vlr = Vlr::default();
assert!(!vlr.is_copc_hierarchy());
vlr.user_id = "copc".to_string();
vlr.record_id = 1000;
assert!(vlr.is_copc_hierarchy());
Source§

impl Vlr

Source

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);
Source

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();
Source

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));
Source

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());
Source

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());
Source

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());
Source

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());
Source

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 Clone for Vlr

Source§

fn clone(&self) -> Vlr

Returns a duplicate of the value. Read more
1.0.0§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Vlr

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for Vlr

Source§

fn default() -> Vlr

Returns the “default value” for a type. Read more
Source§

impl PartialEq for Vlr

Source§

fn eq(&self, other: &Vlr) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl TryFrom<&Vlr> for CopcInfoVlr

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(value: &Vlr) -> Result<Self>

Performs the conversion.
Source§

impl TryFrom<&Vlr> for LazVlr

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(vlr: &Vlr) -> Result<LazVlr>

Performs the conversion.
Source§

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> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CloneToUninit for T
where T: Clone,

§

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
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

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

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

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

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

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

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

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.