API

LASDatasets.ClassificationLookupType
struct ClassificationLookup

A lookup record for classification labels. Each class has a short description telling you what it is.

  • class_description_map::Dict{UInt8, String}: Mapping of each class to a description

ClassificationLookup(class_description_map)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/registered_vlrs.jl:14.

ClassificationLookup(class_descriptions)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/registered_vlrs.jl:22.

source
LASDatasets.ExtendedPointRecordType
struct ExtendedPointRecord{TPoint, Names, Types} <: LASDatasets.LasRecord

A LAS record that has a LAS point and extra user-defined point fields. Note that these must be documented as ExtraBytes VLRs in the LAS file

  • point::Any: The LAS point stored in this record

  • user_fields::LASDatasets.UserFields: Extra user fields associated with this point

source
LASDatasets.ExtraBytesType
struct ExtraBytes{TData}

Extra Bytes record that documents an extra field present for a point in a LAS file

  • options::UInt8: Specifies whether the min/max range, scale factor and offset for this field is set/meaningful and whether there is a special value to be interpreted as "NO_DATA"

  • name::String: Name of the extra field

  • no_data::Any: A value that's used if the "NO_DATA" flag is set in options. Use this if the point doesn't have data for this type

  • min_val::Any: Minimum value for this field, zero if not using

  • max_val::Any: Maximum value for this field, zero if not using

  • scale::Any: Scale factor applied to this field, zero if not using

  • offset::Any: Offset applied to this field, zero if not using

  • description::String: Description of this extra field

source
LASDatasets.FullRecordType
struct FullRecord{TPoint, Names, Types, N} <: LASDatasets.LasRecord

A LAS record that has a LAS point, extra user-defined fields and additional undocumented extra bytes

  • point::Any: The LAS point stored in this record

  • user_fields::LASDatasets.UserFields: Extra user fields associated with this point

  • undoc_bytes::StaticArraysCore.SVector{N, UInt8} where N: Array of extra bytes after the point that haven't been documented in the VLRs

source
LASDatasets.GeoAsciiParamsTagType
struct GeoAsciiParamsTag

An array of ASCII data that contains many strings separated by null terminator characters in ascii_params. These are referenced by position from the data in a GeoKeys record

source
LASDatasets.GeoKeysType
struct GeoKeys

Contains the TIFF keys that defines a coordinate system. A complete description can be found in the GeoTIFF format specification.

As per the spec:

  • key_directory_version = 1 always
  • key_revision = 1 always
  • minor_revision = 0 always

This may change in future LAS spec versions

source
LASDatasets.KeyEntryType
struct KeyEntry

A key entry for a piece o0f GeoTIFF data

  • keyid::UInt16: Defined key ID for each piece of GeoTIFF data. IDs contained in the GeoTIFF specification

  • tiff_tag_location::UInt16: Indicates where the data for this key is located

  • count::UInt16: Number of characters in string for values of GeoAsciiParamsTag, otherwise is 1

  • value_offset::UInt16: Contents vary depending on value for tiff_tag_location above

source
LASDatasets.LASDatasetType
struct LASDataset

A wrapper around a LAS dataset. Contains point cloud data in tabular format as well as metadata and VLR's/EVLR's

  • header::LasHeader: The header from the LAS file the points were extracted from

  • pointcloud::TypedTables.FlexTable: Point cloud data stored in a Tabular format for convenience

  • vlrs::Vector{LasVariableLengthRecord}: Collection of Variable Length Records from the LAS file

  • evlrs::Vector{LasVariableLengthRecord}: Collection of Extended Variable Length Records from the LAS file

  • user_defined_bytes::Vector{UInt8}: Extra user bytes packed between the Header block and the first VLR of the source LAS file

  • unit_conversion::StaticArraysCore.SVector{3, Float64}: Unit conversion factors applied to each axis when the dataset is ingested. This is reversed when you save the dataset to keep header/coordinate system information consistent

source
LASDatasets.LASDatasetMethod
LASDataset(
    pointcloud::AbstractVector{<:NamedTuple};
    vlrs,
    evlrs,
    user_defined_bytes,
    scale
) -> LASDataset

Create a LASDataset from a pointcloud and optionally vlrs/evlrs/userdefinedbytes, NO header required.

source
LASDatasets.LasHeaderType
mutable struct LasHeader

A LAS Header containing metadata regarding information in a LAS file See full specification here

  • las_version::VersionNumber: The LAS spec version this header was written in

  • file_source_id::UInt16: Numeric identifier for the source that made this file. Set to 0 if the ID is unassigned

  • global_encoding::UInt16: A bit field used to indicate global properties. See the spec for more info

  • guid_1::UInt32: First member of the Project GUID

  • guid_2::UInt16: Second member of the Project GUID

  • guid_3::UInt16: Third member of the Project GUID

  • guid_4::NTuple{8, UInt8}: Fourth member of the Project GUID

  • system_id::NTuple{32, UInt8}: A unique identifier indicating how the data was created

  • software_id::NTuple{32, UInt8}: Identifier for the software that created the LAS file

  • creation_dayofyear::UInt16: The Greenwich Mean Time (GMT) day of the year (as an unsigned short) on which the file was created

  • creation_year::UInt16: Four digit number for the year the file was created

  • header_size::UInt16: Size (in bytes) of the public header block in the LAS file. This varies depending on which LAS version was used to write it. For LAS v1.4 it's 375 bytes

  • data_offset::UInt32: Offset to the point data (in bytes) from the start of the file to the first field of the first point record

  • n_vlr::UInt32: Number of Variable Length Records (VLR's) in the LAS file. These come after the header and before the point records

  • data_format_id::UInt8: Point data record format stored in the LAS file. LAS v1.4 supports formats 0-10

  • data_record_length::UInt16: Size in bytes of a point data record

  • legacy_record_count::UInt32: For maintaining legacy compatibility, the number of point records in the file (must not exceed typemax(UInt32)). Only populated for point records 0-5

  • legacy_point_return_count::NTuple{5, UInt32}: For maintaining legacy compatibility, the number of points per return (max of 5 returns, counts must not exceed typemax(UInt32)). Only populated for point records 0-5

  • spatial_info::SpatialInfo: Spatial information describing the bounding range of the points, their offsets and any scaling factor applied to them

  • waveform_record_start::UInt64: Offset in bytes from the start of the file to the first byte of the Waveform Data Package Reckord

  • evlr_start::UInt64: Offset in bytes from the start of the file to the first byte of the first Extended Variable Length Record (EVLR)

  • n_evlr::UInt32: Number of EVLR's in the LAS file

  • record_count::UInt64: Number of point records saved in this file (can't exceed typemax(UInt64)). This is populated for LAS v1.4

  • point_return_count::NTuple{15, UInt64}: Number of points per return saved in this file (15 returns total, counts can't exceed typemax(UInt64)). This is populated for LAS v1.4

source
LASDatasets.LasPointType

An abstract type of LasPoint. Implemented by concrete types for formats that are supported in the spec

source
LASDatasets.LasRecordType
abstract type LasRecord

An abstract form of a LAS record. These are points with some additional information possibly included

source
LASDatasets.LasVariableLengthRecordType
mutable struct LasVariableLengthRecord{TData}

A variable length record included in a LAS file. This stores a particular data type TData in the record, which can be a known VLR such as a WKT transform or a custom struct. To properly define I/O methods for VLR's of custom structs, you must register which user and record ID's this struct type will use using

@register_vlr_type TData user_id record_ids

And overload the methods read_vlr_data and write_vlr_data for your type TData

See the LAS v1.4 spec here for more details.

  • reserved::UInt16

  • user_id::String

  • record_id::UInt16: Numerical ID assigned to this record type

  • description::String

  • data::Any

  • extended::Bool

source
LASDatasets.OGC_WKTType
struct OGC_WKT

A Coordinate System WKT record specified by the Open Geospatial Consortium (OGC) spec

  • wkt_str::String: The WKT formatted string for the coordinate system

  • nb::Int64: Number of bytes in the WKT string

  • unit::Union{Missing, String}: Units applied along the horizontal (XY) plane in this coordinate system

  • vert_unit::Union{Missing, String}: Units applied along the vertical (Z) axis in this coordinate system. Note: this will not in general match the horizontal coordinate

source
LASDatasets.PointRecordType
struct PointRecord{TPoint} <: LASDatasets.LasRecord

A LAS record that only has a point

  • point::Any: The LAS point stored in this record
source
LASDatasets.SpatialInfoType
struct SpatialInfo

A wrapper around the spatial information for points in a LAS dataset, specifically the bounding box, overall translation and scaling factors applied to each point

source
LASDatasets.TextAreaDescriptionType
struct TextAreaDescription

A wrapper around a text area description, which is used for providing a textual description of the content of the LAS file

  • txt::String: Text describing the content of the LAS file
source
LASDatasets.UndocPointRecordType
struct UndocPointRecord{TPoint, N} <: LASDatasets.LasRecord

A LAS record that has a point as well as additional undocumented bytes (i.e. that don't have an associated ExtraBytes VLR)

  • point::Any: The LAS point stored in this record

  • undoc_bytes::StaticArraysCore.SVector{N, UInt8} where N: Array of extra bytes after the point that haven't been documented in the VLRs

source
LASDatasets.UserFieldsType
struct UserFields{Names, Types}

A collection of user-defined non-standard point fields in LAS These will be documented in the "Extra Bytes" VLR of your LAS file

  • values::NamedTuple{Names, Types} where {Names, Types}: Mapping of field names to values. Note that values must match the corresponding field type included in the UserFields Type parameter

UserFields(values)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/records.jl:12.

UserFields(fields)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/records.jl:16.

source
LASDatasets.WaveformPacketDescriptorType
struct WaveformPacketDescriptor

A Wave Packet Descriptor which contains information that describes the configuration of the waveform packets. Since systems may be configured differently at different times throughout a job, the LAS file supports 255 Waveform Packet Descriptors

  • bits_per_sample::UInt8: Number of bits per sample. 2 to 32 bits per sample are supported

  • compression_type::UInt8: Indicates the compression algorithm used for the waveform packets associated with this descriptor. A value of 0 indicates no compression. Zero is the only value currently supported

  • num_samples::UInt32: Number of samples associated to this packet type. This always corresponds to the decompressed waveform packet

  • temporal_sample_spacing::UInt32: The temporal sample spacing in picoseconds. Example values might be 500, 1000, 2000, and so on, representing digitizer frequencies of 2 GHz, 1 GHz, and 500 MHz respectively.

  • digitizer_gain::Float64: The digitizer gain used to convert the raw digitized value to an absolute digitizer voltage using the formula: 𝑉𝑂𝐿𝑇𝑆 = 𝑂𝐹𝐹𝑆𝐸𝑇 + 𝐺𝐴𝐼𝑁 * 𝑅𝑎𝑤𝑊𝑎𝑣𝑒𝑓𝑜𝑟𝑚𝐴𝑚𝑝𝑙𝑖𝑡𝑢𝑑𝑒

  • digitizer_offset::Float64: The digitizer offset used to convert the raw digitized value to an absolute digitizer using formula above
source
LASDatasets.add_column!Method
add_column!(
    las::LASDataset,
    column::Symbol,
    values::AbstractArray{T, 1}
)

Add a column with name column and set of values to a las dataset

source
LASDatasets.add_extra_bytes!Method
add_extra_bytes!(
    las::LASDataset,
    col_name::Symbol,
    _::Type{T},
    extra_bytes_vlr::LasVariableLengthRecord{ExtraBytesCollection}
) -> Int64

Add an extra bytes VLR to a LAS dataset to document an extra user-field for points

Arguments

  • las : LAS dataset to add extra bytes to
  • col_name : Name to save the user field as
  • T : Data type for the user field (must be a base type as specified in the spec or a static vector of one of these types)
  • extra_bytes_vlr : An Extra Bytes Collection VLR that already exists in the dataset
source
LASDatasets.add_extra_bytes_to_collection!Method
add_extra_bytes_to_collection!(
    collection::ExtraBytesCollection,
    col_name::Symbol,
    _::Type{T}
) -> Vector{ExtraBytes}

Construct an extra bytes VLR with a field name col_name and data type T

source
LASDatasets.add_points!Method
add_points!(
    las::LASDataset,
    points::AbstractVector{<:NamedTuple}
)

Add a collection of points to a LASDataset, las. Updates header information to ensure dataset consistency

source
LASDatasets.add_vlr!Method
add_vlr!(
    las::LASDataset,
    vlr::LasVariableLengthRecord
) -> Union{Nothing, Int64}

Add a vlr into the set of VLRs in a LAS dataset las. Note that this will modify the header content of las, including updating its LAS version to v1.4 if vlr is extended

source
LASDatasets.check_data_against_record_idMethod
check_data_against_record_id(
    data,
    user_id::String,
    record_id::Integer,
    extended::Bool
)

Check that the user_id and record_id given are appropriate for a known VLR type data entry data

source
LASDatasets.conversion_from_vlrsMethod
conversion_from_vlrs(
    wkt::OGC_WKT;
    convert_x_y_units,
    convert_z_units
) -> Union{Missing, StaticArraysCore.SVector{3, Float64}}

Given an OGC WKT coordinate system wkt, attempt to parse conversion units (to metres) with optional operator supplied overrides. Can opt to convert all axes units or just the vertical.

source
LASDatasets.convert_units!Method
convert_units!(
    pointcloud::AbstractVector{<:NamedTuple},
    vlrs::Vector{LasVariableLengthRecord},
    convert_x_y_units::Union{Missing, String},
    convert_z_units::Union{Missing, String};
    verbose
) -> StaticArraysCore.SVector{3, Float64}

Convert the position units of some pointcloud data into metres based upon the coordinate units in the LAS file's vlrs. Can override the unit conversion by manually specifying a unit to convert on the XY-plane, convert_x_y_units, and/or a unit to convert on the z-axis convert_z_units (missing if not overriding)

source
LASDatasets.data_type_from_idsMethod
data_type_from_ids(
    user_id::String,
    record_id::Integer
) -> DataType

Get the data type associated with a particular user_id and record_id. This is used to automatically parse VLR data types on reading NOTE: If the user and record ID combination hasn't been registered, will default to Vector{UInt8} and the VLR data will be returned as raw bytes.

source
LASDatasets.evlr_startMethod
evlr_start(header::LasHeader) -> UInt64

Get the offset in bytes to the first EVLR in a LAS file from a header header

source
LASDatasets.extract_vlr_typeMethod
extract_vlr_type(
    vlrs::Vector{<:LasVariableLengthRecord},
    user_id::String,
    record_id::Integer
) -> Union{Nothing, LasVariableLengthRecord}

Extract the VLR with a user_id and record_id from a collection of VLRs, vlrs

source
LASDatasets.flag_byteMethod

Flag byte, contains return number, number of returns, scan direction flag and edge of flight line

source
LASDatasets.get_cols_and_extractorsMethod
get_cols_and_extractors(
    _::Type{TPoint<:LasPoint},
    required_columns,
    xyz::SpatialInfo
) -> Tuple{Any, Any}

Helper function that gets the compatible column names from a user-requested set of columns and a particular point format

Arguments

  • TPoint : Type of LasPoint format to check column compatibility for
  • required_columns : Set of columns requested by the user (if empty, use all columns included in the format TPoint)
  • xyz : Spatial information used to apply scaling/offset factors to point positions
source
LASDatasets.get_evlrsMethod
get_evlrs(
    las::LASDataset
) -> Vector{LasVariableLengthRecord}

Extract the set of Extended Variable Length Records from a LASDataset las

source
LASDatasets.get_extra_bytesMethod
get_extra_bytes(
    collection::ExtraBytesCollection
) -> Vector{ExtraBytes}

Helper function that gets the set of Extra Bytes records from an Extra Bytes collection

source
LASDatasets.get_field_nameFunction
get_field_name(extractor::Extractor{TColumn}, point_type::Type{TPoint}) where {TPoint, TColumn}

Gets the field name in the point_type for column TColumn.

source
LASDatasets.get_num_undocumented_bytesFunction

Helper function to get the number of undocumented extra bytes associated with a LAS point record

get_num_undocumented_bytes(_)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/records.jl:126.

get_num_undocumented_bytes(_)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/records.jl:158.

get_num_undocumented_bytes(_)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/records.jl:187.

get_num_undocumented_bytes(_)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/records.jl:216.

source
LASDatasets.get_num_user_field_bytesFunction

Helper function to get the number of bytes making up user-defined fields associated with a LAS point record

get_num_user_field_bytes(_)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/records.jl:125.

get_num_user_field_bytes(_)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/records.jl:155.

get_num_user_field_bytes(_)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/records.jl:186.

get_num_user_field_bytes(_)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/records.jl:213.

source
LASDatasets.get_point_formatFunction

Helper function to get the LAS point format associated with a LAS point record

get_point_format(table)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/parse_points.jl:19.

get_point_format(columns)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/parse_points.jl:21.

get_point_format(_)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/points.jl:230.

get_point_format(_)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/points.jl:231.

get_point_format(_)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/points.jl:232.

get_point_format(_)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/points.jl:233.

get_point_format(_)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/points.jl:234.

get_point_format(_)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/points.jl:235.

get_point_format(_)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/points.jl:236.

get_point_format(_)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/points.jl:237.

get_point_format(_)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/points.jl:238.

get_point_format(_)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/points.jl:239.

get_point_format(_)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/points.jl:240.

get_point_format(_)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/points.jl:241.

get_point_format(_)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/points.jl:253.

get_point_format(_)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/records.jl:124.

get_point_format(_)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/records.jl:154.

get_point_format(_)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/records.jl:185.

get_point_format(_)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/records.jl:212.

source
LASDatasets.get_point_formatMethod
get_point_format(table::AbstractVector{<:NamedTuple}) -> Any

Get the minimum point format that is compatible with the contents of a point cloud in a table

source
LASDatasets.get_point_formatMethod
get_point_format(
    _::Type{TPoint<:LasPoint}
) -> Type{LasPoint10}

Get the concrete point format struct from an abstract LasPoint type

get_point_format(_)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/points.jl:230.

get_point_format(_)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/points.jl:231.

get_point_format(_)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/points.jl:232.

get_point_format(_)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/points.jl:233.

get_point_format(_)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/points.jl:234.

get_point_format(_)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/points.jl:235.

get_point_format(_)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/points.jl:236.

get_point_format(_)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/points.jl:237.

get_point_format(_)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/points.jl:238.

get_point_format(_)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/points.jl:239.

get_point_format(_)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/points.jl:240.

get_point_format(_)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/points.jl:241.

get_point_format(_)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/points.jl:253.

source
LASDatasets.get_record_bytesMethod
get_record_bytes(
    records::StructArrays.StructArray{TRecord<:LASDatasets.LasRecord, 1},
    vlrs::Vector{LasVariableLengthRecord}
) -> Any

Construct an array of bytes that correctly encodes the information stored in a set of LAS records according to the spec

source
LASDatasets.get_unit_conversionMethod
get_unit_conversion(
    las::LASDataset
) -> StaticArraysCore.SVector{3, Float64}

Get the unit factor conversion that was applied to this dataset when ingested

source
LASDatasets.get_user_field_mapMethod
get_user_field_map(
    user_fields::Union{Tuple, Vector}
) -> Dict{Symbol, Vector{Symbol}}

Helper function that maps a user field name to the set of user field names in the Extra Bytes VLRs that are entries for this field. If a user field is a scalar, this will simply map user_field => [user_field]. If it is a vector, it will map col => ["col [0]", "col [1]", ..., "col [N]"]

source
LASDatasets.get_user_fields_for_tableMethod
get_user_fields_for_table(
    records::Array{TRecord<:Union{LASDatasets.ExtendedPointRecord, LASDatasets.FullRecord}, 1},
    Names::Tuple,
    required_columns
) -> Tuple{Vector{Symbol}, Tuple}

Helper function that finds the names of user-defined point fields that have been requested by a user and group them together if they form arrays in the output data. Note according to spec that user-defined array field names must be of the form col [0], col[1], ..., col[N] where N is the dimension of the user field

source
LASDatasets.get_vlrsMethod
get_vlrs(las::LASDataset) -> Vector{LasVariableLengthRecord}

Extract the set of Variable Length Records from a LASDataset las

source
LASDatasets.group_user_fieldsMethod
group_user_fields(
    raw_user_data::Dict{Symbol, Vector},
    user_field_map::Dict{Symbol, Vector{Symbol}}
) -> Tuple

Helper function that groups raw user field data into either a vector of scalars or vector of vectors

Arguments

  • raw_user_data : Maps the raw user field names (as they appear in the Extra Bytes VLRs, e.g. "col" for scalar or "col [n]" for entry in array) to their data in each point record
  • user_field_map : Maps each user field base name to the collection of raw user field names composing it
source
LASDatasets.is_standard_gpsMethod

If true, GPS Time is standard GPS Time (satellite GPS Time) minus 1e9. If false, GPS Time is GPS Week Time.

Note that not all software sets this encoding correctly.

source
LASDatasets.las_recordMethod
las_record(
    ::Type{TPoint<:LasPoint},
    p::NamedTuple,
    xyz::SpatialInfo,
    undoc_bytes::StaticArraysCore.SArray{Tuple{N}, UInt8, 1, N}
) -> Union{LASDatasets.PointRecord, LASDatasets.UndocPointRecord}
las_record(
    ::Type{TPoint<:LasPoint},
    p::NamedTuple,
    xyz::SpatialInfo,
    undoc_bytes::StaticArraysCore.SArray{Tuple{N}, UInt8, 1, N},
    user_fields
) -> Union{LASDatasets.ExtendedPointRecord, LASDatasets.FullRecord, LASDatasets.PointRecord, LASDatasets.UndocPointRecord}

Construct a LAS record for a point in a tabular point cloud

Arguments

  • TPoint : Type of the LAS point to construct from this point data
  • p : Point entry in a tabular point cloud
  • xyz : Spatial information about scaling, offsets and bounding ranges of the point cloud
  • user_fields : Tuple of user-defined fields to append to the point record (empty if not using). Note: these must match what's in your point p. Default ()
source
LASDatasets.laspointFunction

A convenience function that creates a LasPoint from a given struct and some spatial information

laspoint(_, p, xyz)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/parse_points.jl:7.

laspoint(_, p, xyz)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/parse_points.jl:197.

laspoint(_, p, xyz)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/parse_points.jl:228.

laspoint(_, p, xyz)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/parse_points.jl:260.

laspoint(_, p, xyz)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/parse_points.jl:295.

laspoint(_, p, xyz)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/parse_points.jl:332.

laspoint(_, p, xyz)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/parse_points.jl:376.

laspoint(_, p, xyz)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/parse_points.jl:447.

laspoint(_, p, xyz)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/parse_points.jl:481.

laspoint(_, p, xyz)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/parse_points.jl:521.

laspoint(_, p, xyz)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/parse_points.jl:563.

laspoint(_, p, xyz)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/parse_points.jl:611.

source
LASDatasets.load_lasMethod
load_las(file_name::AbstractString; ...) -> LASDataset
load_las(
    file_name::AbstractString,
    fields;
    kwargs...
) -> LASDataset

Load a LAS dataset from a source file

Arguments

  • file_name : Name of the LAS file to extract data from
  • fields : Name of the LAS point fields to extract as columns in the output data. If set to nothing, ingest all available columns. Default DEFAULT_LAS_COLUMNS
source
LASDatasets.load_pointcloudFunction
load_pointcloud(
    file_name::AbstractString;
    ...
) -> TypedTables.FlexTable
load_pointcloud(
    file_name::AbstractString,
    fields::Union{Nothing, AbstractVector{Symbol}};
    kwargs...
) -> TypedTables.FlexTable

Ingest LAS point data in a tabular format

source
LASDatasets.make_consistent_header!Method
make_consistent_header!(
    header::LasHeader,
    pointcloud::AbstractVector{<:NamedTuple},
    vlrs::Vector{<:LasVariableLengthRecord},
    evlrs::Vector{<:LasVariableLengthRecord},
    user_defined_bytes::Vector{UInt8}
)

Ensure that a LAS header is consistent with a given pointcloud data coupled with sets of vlrs, evlrs and user_defined_bytes

source
LASDatasets.make_consistent_headerMethod
make_consistent_header(
    pointcloud::AbstractVector{<:NamedTuple},
    point_format::Type{TPoint<:LasPoint},
    vlrs::Vector{<:LasVariableLengthRecord},
    evlrs::Vector{<:LasVariableLengthRecord},
    user_defined_bytes::Vector{UInt8},
    scale::Union{Real, AxisInfo, StaticArraysCore.SVector{3, <:Real}}
) -> LasHeader

Construct a LAS header that is consistent with a given pointcloud data in a specific LAS point_format, coupled with sets of vlrs, evlrs and user_defined_bytes

source
LASDatasets.make_tableMethod
make_table(
    records::Array{LASDatasets.PointRecord{TPoint<:LasPoint}, 1},
    required_columns,
    xyz::SpatialInfo
) -> TypedTables.Table{_A, _B, NamedTuple{names, T}} where {_A<:NamedTuple, _B, names, T<:Tuple{Vararg{AbstractArray{<:Any, _B}}}}

Convert a collection of LAS point records into a Table with the desired columns

Arguments

  • records : A collection of LasRecords that have been read from a LAS file
  • required_columns : Set of columns to include in the table being constructed
  • xyz : Spatial information used to apply scaling/offset factors to point positions
make_table(records, required_columns, xyz)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/read.jl:143.

source
LASDatasets.merge_column!Method
merge_column!(
    las::LASDataset,
    column::Symbol,
    values::AbstractVector
) -> Any

Merge a column with name column and a set of values into a las dataset

source
LASDatasets.nameMethod
name(e::ExtraBytes) -> String

Get the name of an additional user field that's documented by an extra bytes record e

source
LASDatasets.official_user_idMethod
official_user_id(_::Type{TData}) -> String

The registered user ID associated to VLRs of this record type TData. Currently assuming one user ID per data type

source
LASDatasets.read_final_fieldsMethod
read_final_fields(
    io::IO,
    las_version::VersionNumber,
    is_at_least_v14::Bool
) -> Tuple{Any, Tuple{Vararg{UInt32}}, SpatialInfo, Any, Any, Any, Any, Tuple{Vararg{UInt64}}}

Helper function that reads the last few fields (from legacy record count to point return count) of a LAS header from an io

source
LASDatasets.read_las_dataMethod
read_las_data(io; ...) -> LASDataset
read_las_data(
    io::IO,
    required_columns;
    convert_to_metres,
    convert_x_y_units,
    convert_z_units
) -> LASDataset

Read LAS data from an IO source

Arguments

  • io : IO Channel to read the data in from
  • required_columns : Point record fields to extract as columns in the output data, default DEFAULT_LAS_COLUMNS

Keyword Arguments

  • convrt_to_metres : Flag indicating that point coordinates will be converted to metres upon reading, default true
  • convert_x_y_units : Name of the units used to measure point coordinates in the LAS file that will be converted to metres when ingested. Set to missing for no conversion (default missing)
  • convert_z_units : Name of the units on the z-axis in the LAS file that will be converted to metres when ingested. Set to missing for no conversion (default missing)
source
LASDatasets.read_vlr_dataMethod
read_vlr_data(
    io::IO,
    _::Type{TData},
    nb::Integer
) -> GeoDoubleParamsTag

Read data of type TData that belongs to a VLR by readig nb bytes from an io. By default this will call Base.read, but for more specific read methods this will need to be overloaded for your type

source
LASDatasets.record_formatFunction
record_format(header::LasHeader) -> Type
record_format(
    header::LasHeader,
    extra_bytes::Vector{<:ExtraBytes}
) -> Type

Get the appropriate LAS record format for a LAS header and a (possibly empty) set of extra_bytes that document any optional user fields to include

source
LASDatasets.remove_points!Method
remove_points!(
    las::LASDataset,
    idxs::Union{AbstractUnitRange, AbstractVector{<:Integer}}
)

Remove a set of points stored at indices idxs from a las dataset. Updates header information to ensure consistency

source
LASDatasets.remove_vlr!Method
remove_vlr!(
    las::LASDataset,
    vlr::LasVariableLengthRecord
) -> Union{Nothing, Int64}

Remove a vlr from set of VLRs in a LAS dataset las. Note that this will modify the header content of las

source
LASDatasets.save_lasMethod
save_las(
    file_name::AbstractString,
    pointcloud::AbstractVector{<:NamedTuple};
    vlrs,
    evlrs,
    user_defined_bytes,
    scale,
    kwargs...
)

Saves a pointcloud to LAS or LAZ. The appropriate LAS version and point format is inferred from the contents of your point cloud

Arguments

  • file_name : Name of the LAS file to save the data into
  • pointcloud : Point cloud data in a tabular format

Keyword Arguments

  • vlrs : Collection of Variable Length Records to write to the LAS file, default LasVariableLengthRecord[]
  • evlrs : Collection of Extended Variable Length Records to write to the LAS file, default LasVariableLengthRecord[]
  • user_defined_bytes : Any user-defined bytes to write in between the VLRs and point records, default UInt8[]
  • scale : Scaling factor applied to points on writing, default LASDatasets.POINT_SCALE

save_las(
    file_name,
    pointcloud;
    vlrs,
    evlrs,
    user_defined_bytes,
    scale,
    kwargs...
)

defined at /home/runner/work/LASDatasets.jl/LASDatasets.jl/src/write.jl:18.

source
LASDatasets.scaleMethod
scale(h::LasHeader, axis::Symbol) -> Float64

Get the scale for point positions in a LAS file from a header h along an axis (x, y or z)

source
LASDatasets.scaleMethod
scale(h::LasHeader) -> AxisInfo{Float64}

Get the scale for point positions in a LAS file from a header h along all axes

source
LASDatasets.set_evlr_start!Method
set_evlr_start!(header, offset::Integer) -> Integer

Set the offset (in bytes) into the LAS file where the first EVLR occurs

source
LASDatasets.set_num_evlr!Method
set_num_evlr!(header::LasHeader, n::Integer) -> UInt64

Set the number of Extended Variable Length Records in a LAS file with a header header

source
LASDatasets.set_num_vlr!Method
set_num_vlr!(header::LasHeader, n::Integer) -> UInt64

Set the number of Variable Length Records in a LAS file with a header header

source
LASDatasets.set_point_record_length!Method
set_point_record_length!(
    header::LasHeader,
    length::Integer
) -> UInt16

Set the number of bytes associated to each point record in a LAS file with a header header

source
LASDatasets.set_spatial_info!Method
set_spatial_info!(
    header::LasHeader,
    info::SpatialInfo
) -> SpatialInfo

Set the spatial information associated to points in a LAS file with a header header

source
LASDatasets.set_superseded!Method
set_superseded!(vlr::LasVariableLengthRecord) -> UInt16

Mark a VLR as "superseded", meaning it has been replaced by a newer record when modifying the LAS file. Note: The LAS spec only allows for 1 superseded record per LAS file

source
LASDatasets.set_wkt_bit!Method
set_wkt_bit!(header::LasHeader) -> UInt16

Sets the bit flag indicating that the LAS file with header header has its coordinate reference system set as a WKT

source
LASDatasets.spatial_infoMethod
spatial_info(h::LasHeader) -> SpatialInfo

Get the spatial information for point positions in a LAS file from a header h. This includes the offsets/scale factors applied to points and bounding box information

source
LASDatasets.split_column_nameMethod
split_column_name(col::Symbol, dim::Integer) -> Any

Helper function that returns a list of extra bytes VLR field names for each entry in a user-defined array with column name col and dimension dim

source
LASDatasets.units_to_conversionFunction
units_to_conversion(
    unit::Union{Missing, String}
) -> Union{Missing, StaticArraysCore.SVector{3, Float64}}
units_to_conversion(
    unit::Union{Missing, String},
    v_unit::Union{Missing, String}
) -> Missing

Parse the specified units into a conversion vector.

source
LASDatasets.unset_wkt_bit!Method
unset_wkt_bit!(header::LasHeader) -> UInt16

Sets the bit flag indicating that the LAS file with header header doesn't have its coordinate reference system set as a WKT

source
LASDatasets.write_lasMethod
write_las(
    io::IO,
    pointcloud::AbstractVector{<:NamedTuple},
    point_format::Type{TPoint},
    vlrs::Vector{<:LasVariableLengthRecord},
    evlrs::Vector{<:LasVariableLengthRecord},
    user_defined_bytes::Vector{UInt8},
    scale::Real
)

Write a pointcloud and additional VLR's and user-defined bytes to an IO stream in a LAS format

Arguments

  • io : IO channel to write the data to
  • pointcloud : Pointcloud data in a tabular format to write
  • vlrs : Collection of Variable Length Records to write to io
  • evlrs : Collection of Extended Variable Length Records to write to io
  • user_defined_bytes : Any user-defined bytes to write in between the VLRs and point records
  • scale : Scaling factor applied to points on writing
source
LASDatasets.write_vlr_dataMethod
write_vlr_data(io::IO, data) -> Any

Write data of type TData that belongs to a VLR to an io. By default this will call Base.write, but for more specific write methods this will need to be overloaded for your type

source
LASDatasets.writestringMethod
writestring(io, str::AbstractString, nb::Integer) -> Any

Write a string str to an IO channel io, writing exactly nb bytes (padding if str is too short)

source
LASDatasets.xcoordMethod

X value (Int32), as represented in the point data, reversing the offset and scale from the header

source
LASDatasets.ycoordMethod

Y value (Int32), as represented in the point data, reversing the offset and scale from the header

source
LASDatasets.zcoordMethod

Z value (Int32), as represented in the point data, reversing the offset and scale from the header

source