Struct las::point::Point

source ·
pub struct Point {
Show 22 fields pub x: f64, pub y: f64, pub z: f64, pub intensity: u16, pub return_number: u8, pub number_of_returns: u8, pub scan_direction: ScanDirection, pub is_edge_of_flight_line: bool, pub classification: Classification, pub is_synthetic: bool, pub is_key_point: bool, pub is_withheld: bool, pub is_overlap: bool, pub scanner_channel: u8, pub scan_angle: f32, pub user_data: u8, pub point_source_id: u16, pub gps_time: Option<f64>, pub color: Option<Color>, pub waveform: Option<Waveform>, pub nir: Option<u16>, pub extra_bytes: Vec<u8>,
}
Expand description

A three dimensional point.

Fields§

§x: f64

The x coordinate, as a float.

§y: f64

The y coordinate, as a float.

§z: f64

The z coordinate, as a float.

§intensity: u16

The integer representation of the pulse return magnitude.

This value is optional and system specific, but should be included when available. Because there is no way to indicate the “optionalness” of the intensity value and since zero could be valid intensity, we don’t wrap this in an Option.

§return_number: u8

The pulse return number for a given output pulse.

§number_of_returns: u8

The total number of returns for a given pulse.

§scan_direction: ScanDirection

The direction at which the scanner mirror was traveling at the time of the output pulse.

§is_edge_of_flight_line: bool

True if the point is at the end of a scan.

§classification: Classification

The ASPRS classification for this point.

§is_synthetic: bool

This point was created by a technique other than LiDAR collection.

§is_key_point: bool

The point should be considered a model key-point.

§is_withheld: bool

The point should be considered withheld (i.e. it’s deleted).

§is_overlap: bool

Is this an overlap point?

§scanner_channel: u8

The channel of the scanner, used only in multi-channel systems.

§scan_angle: f32

The angle of the output of the laser pulse.

This is supposed to include the roll of the aircraft, if applicable. Zero degrees is nadir, -90° is to the left.

§user_data: u8

Used at the user’s discretion.

§point_source_id: u16

The file from which this point originated.

This number corresponds to a file source ID.

§gps_time: Option<f64>

The time at which the point was acquired.

§color: Option<Color>

This point’s color.

§waveform: Option<Waveform>

This point’s waveform information.

§nir: Option<u16>

This point’s near infrared value.

§extra_bytes: Vec<u8>

This point’s extra bytes.

These can have structure and meaning, but for now they don’t.

Implementations§

source§

impl Point

source

pub fn new(raw_point: Point, transforms: &Vector<Transform>) -> Point

Creates a point from a raw point.

§Examples
use las::Point;
use las::raw;
let raw_point = raw::Point::default();
let point = Point::new(raw_point, &Default::default());
source

pub fn into_raw(self, transforms: &Vector<Transform>) -> Result<Point>

Creates a raw las point from this point.

§Examples
use las::Point;
let point = Point::default();
let raw_point = point.into_raw(&Default::default()).unwrap();
source

pub fn flags(&self) -> Result<Flags>

Creates the flags bytes for use in a raw point.

§Examples
use las::Point;
let point = Point { return_number: 1, ..Default::default() };
assert_eq!((1, 0, 0), point.flags().unwrap().into());
source

pub fn matches(&self, format: &Format) -> bool

Returns true if this point matches the point format.

“Matches” means that the set of optional attributes is exactly the same.

§Examples
use las::point::Format;
use las::Point;

let mut format = Format::new(0).unwrap();
let mut point = Point::default();
assert!(point.matches(&format));

format.has_gps_time = true;
assert!(!point.matches(&format));

point.gps_time = Some(42.);
assert!(point.matches(&format));

Trait Implementations§

source§

impl Clone for Point

source§

fn clone(&self) -> Point

Returns a copy 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 Point

source§

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

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

impl Default for Point

source§

fn default() -> Point

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

impl PartialEq for Point

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for Point

Auto Trait Implementations§

§

impl Freeze for Point

§

impl RefUnwindSafe for Point

§

impl Send for Point

§

impl Sync for Point

§

impl Unpin for Point

§

impl UnwindSafe for Point

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

§

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

§

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

§

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.