[][src]Struct las::raw::point::Point

pub struct Point {
    pub x: i32,
    pub y: i32,
    pub z: i32,
    pub intensity: u16,
    pub flags: Flags,
    pub scan_angle: ScanAngle,
    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>,
}

A raw point.

The documentation for struct members is taken directly from the las 1.4 spec.

Fields

x: i32

The X, Y, and Z values are stored as long integers.

The X, Y, and Z values are used in conjunction with the scale values and the offset values to determine the coordinate for each point as described in the Public Header Block section.

y: i32z: i32intensity: u16

The intensity value is the integer representation of the pulse return magnitude.

This value is optional and system specific. However, it should always be included if available. Intensity, when included, is always normalized to a 16 bit, unsigned value by multiplying the value by 65,536/(intensity dynamic range of the sensor). For example, if the dynamic range of the sensor is 10 bits, the scaling value would be (65,536/1,024). If intensity is not included, this value must be set to zero. This normalization is required to ensure that data from different sensors can be correctly merged.

flags: Flags

Flags can either be one or two bytes.

One byte

Please note that the following four fields (Return Number, Number of Returns, Scan Direction Flag and Edge of Flight Line) are bit fields within a single byte.

Return Number

The Return Number is the pulse return number for a given output pulse. A given output laser pulse can have many returns, and they must be marked in sequence of return. The first return will have a Return Number of one, the second a Return Number of two, and so on up to five returns.

Number of Returns (given pulse)

The Number of Returns is the total number of returns for a given pulse. For example, a laser data point may be return two (Return Number) within a total number of five returns.

Scan Direction Flag

The Scan Direction Flag denotes the direction at which the scanner mirror was traveling at the time of the output pulse. A bit value of 1 is a positive scan direction, and a bit value of 0 is a negative scan direction (where positive scan direction is a scan moving from the left side of the in-track direction to the right side and negative the opposite).

Edge of Flight Line

The Edge of Flight Line data bit has a value of 1 only when the point is at the end of a scan. It is the last point on a given scan line before it changes direction.

Two bytes

Note that the following five fields (Return Number, Number of Returns, Classification Flags, Scan Direction Flag and Edge of Flight Line) are bit fields, encoded into two bytes.

Return Number

The Return Number is the pulse return number for a given output pulse. A given output laser pulse can have many returns, and they must be marked in sequence of return. The first return will have a Return Number of one, the second a Return Number of two, and so on up to fifteen returns. The Return Number must be between 1 and the Number of Returns, inclusive.

Number of Returns (given pulse)

The Number of Returns is the total number of returns for a given pulse. For example, a laser data point may be return two (Return Number) within a total number of up to fifteen returns.

Classification Flags

Classification flags are used to indicate special characteristics associated with the point. The bit definitions are:

BitField nameDescription
0SyntheticIf set then this point was created by a technique other than LIDAR collection such as digitized from a photogrammetric stereo model or by traversing a waveform.
1Key-pointIf set, this point is considered to be a model key-point and thus generally should not be withheld in a thinning algorithm.
2WithheldIf set, this point should not be included in processing (synonymous with Deleted).
3OverlapIf set, this point is within the overlap region of two or more swaths or takes. Setting this bit is not mandatory (unless, of course, it is mandated by a particular delivery specification) but allows Classification of overlap points to be preserved.

Note that these bits are treated as flags and can be set or cleared in any combination. For example, a point with bits 0 and 1 both set to one and the Classification field set to 2 would be a ground point that had been synthetically collected and marked as a model key-point.

Scanner Channel

Scanner Channel is used to indicate the channel (scanner head) of a multi- channel system. Channel 0 is used for single scanner systems. Up to four channels are supported (0-3).

Scan Direction Flag

The Scan Direction Flag denotes the direction at which the scanner mirror was traveling at the time of the output pulse. A bit value of 1 is a positive scan direction, and a bit value of 0 is a negative scan direction (where positive scan direction is a scan moving from the left side of the in-track direction to the right side and negative the opposite).

Edge of Flight Line

The Edge of Flight Line data bit has a value of 1 only when the point is at the end of a scan. It is the last point on a given scan line before it changes direction or the mirror facet changes. Note that this field has no meaning for 360° Field of View scanners (such as Mobile LIDAR scanners) and should not be set.

Classification

This field also holds the “class” attributes of a point.

If a point has never been classified, this byte must be set to zero. In some point formats, the format for classification is a bit encoded field with the lower five bits used for the class and the three high bits used for flags. In others, the whole byte is used for classes.

Bit field encoding for point data record types 0 to 5

BitField nameDescription
0:4ClassificationStandard ASPRS classification from 0 - 31 as defined in the classification table for legacy point formats
5SyntheticIf set then this point was created by a technique other than LIDAR collection such as digitized from a photogrammetric stereo model or by traversing a waveform.
6Key-pointIf set, this point is considered to be a model key-point and thus generally should not be withheld in a thinning algorithm.
7WithheldIf set, this point should not be included in processing (synonymous with Deleted).

ASPRS standard LiDAR point classes for point data record types 0 to 5

Classification valueMeaning
0Created, never classified
1Unclassified
2Ground
3Low vegetation
4Medium vegetation
5High vegetation
6Building
7Low point (noise)
8Model key-point (mass point)
9Water
10Reserved
11Reserved
12Overlap points
13-31Reserved

ASPRS standard LiDAR point classes for point data record types 6 to 10

Classification valueMeaning
0Created, never classified
1Unclassified
2Ground
3Low vegetation
4Medium vegetation
5High vegetation
6Building
7Low point (noise)
8Model key-point (mass point)
9Water
10Rail
11Road surface
12Overlap points
13Wire - guard (shield)
14Wire - conductor (phase)
15Transmission tower
16Wire-structure connector (e.g. insulator)
17Bridge deck
17High noise
19-63Reserved
64-255Userdefinable
scan_angle: ScanAngle

The scan angle can be stored as rank or scaled.

Rank

The Scan Angle Rank is a signed one-byte number with a valid range from - 90 to +90.

The Scan Angle Rank is the angle (rounded to the nearest integer in the absolute value sense) at which the laser point was output from the laser system including the roll of the aircraft. The scan angle is within 1 degree of accuracy from +90 to –90 degrees. The scan angle is an angle based on 0 degrees being nadir, and –90 degrees to the left side of the aircraft in the direction of flight.

Scaled

The Scan Angle is a signed short that represents the rotational position of the emitted laser pulse with respect to the vertical of the coordinate system of the data. Down in the data coordinate system is the 0.0 position. Each increment represents 0.006 degrees. Counter- Clockwise rotation, as viewed from the rear of the sensor, facing in the along-track (positive trajectory) direction, is positive. The maximum value in the positive sense is 30,000 (180 degrees which is up in the coordinate system of the data). The maximum value in the negative direction is -30.000 which is also directly up.

user_data: u8

This field may be used at the user’s discretion.

point_source_id: u16

This value indicates the file from which this point originated.

Valid values for this field are 1 to 65,535 inclusive with zero being used for a special case discussed below. The numerical value corresponds to the File Source ID from which this point originated. Zero is reserved as a convenience to system implementers. A Point Source ID of zero implies that this point originated in this file. This implies that processing software should set the Point Source ID equal to the File Source ID of the file containing this point at some time during processing.

gps_time: Option<f64>

The GPS Time is the double floating point time tag value at which the point was acquired.

It is GPS Week Time if the Global Encoding low bit is clear and Adjusted Standard GPS Time if the Global Encoding low bit is set (see Global Encoding in the Public Header Block description).

color: Option<Color>

The red, green, and blue image channels associated with this point.

The Red, Green, Blue values should always be normalized to 16 bit values. For example, when encoding an 8 bit per channel pixel, multiply each channel value by 256 prior to storage in these fields. This normalization allows color values from different camera bit depths to be accurately merged.

waveform: Option<Waveform>nir: Option<u16>

The NIR (near infrared) channel value associated with this point.

extra_bytes: Vec<u8>

Implementations

impl Point[src]

pub fn read_from<R: Read>(read: R, format: &Format) -> Result<Point>[src]

Reads a raw point.

Examples

use std::io::{Seek, SeekFrom};
use std::fs::File;
use las::raw::Point;
use las::point::Format;
let mut file = File::open("tests/data/autzen.las").unwrap();
file.seek(SeekFrom::Start(1994)).unwrap();
let point = Point::read_from(file, &Format::new(1).unwrap()).unwrap();

pub fn write_to<W: Write>(&self, write: W, format: &Format) -> Result<()>[src]

Writes a raw pont.

Examples

Write implements WriteRawPoint.

use std::io::Cursor;
use las::raw::Point;
use las::point::Format;
let mut cursor = Cursor::new(Vec::new());
let point = Point::default();
point.write_to(cursor, &Format::default()).unwrap();

Trait Implementations

impl Clone for Point[src]

impl Debug for Point[src]

impl Default for Point[src]

impl PartialEq<Point> for Point[src]

impl StructuralPartialEq for Point[src]

Auto Trait Implementations

impl RefUnwindSafe for Point

impl Send for Point

impl Sync for Point

impl Unpin for Point

impl UnwindSafe for Point

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.