3D Forest
Software for analysis of Lidar data from forest environment.
LasFile Class Reference

#include <LasFile.hpp>

Classes

struct  AttributesBuffer
 
class  Format
 
struct  Header
 
struct  Point
 

Public Types

enum  Classification {
  CLASS_NEVER_CLASSIFIED , CLASS_UNASSIGNED , CLASS_GROUND , CLASS_LOW_VEGETATION ,
  CLASS_MEDIUM_VEGETATION , CLASS_HIGH_VEGETATION , CLASS_BUILDING
}
 

Public Member Functions

 LasFile ()
 
 ~LasFile ()
 
void open (const std::string &path)
 
void create (const std::string &path)
 
void close ()
 
bool open () const
 
void seekPoint (uint64_t index)
 
void readPoint (Point &pt)
 
void writePoint (const Point &pt)
 
uint64_t size () const
 
uint64_t offset () const
 
void seek (uint64_t offset)
 
void seekHeader ()
 
void seekVlr ()
 
void seekPointData ()
 
void seekExtendedVlr ()
 
void readHeader ()
 
void writeHeader ()
 
void readBuffer (uint8_t *buffer, uint64_t nbyte)
 
void writeBuffer (const uint8_t *buffer, uint64_t nbyte)
 
void formatBytesToPoint (Point &pt, const uint8_t *buffer) const
 
void formatPointToBytes (uint8_t *buffer, const Point &pt) const
 
void createAttributesBuffer (AttributesBuffer &buffer, uint64_t n, bool setZero=false)
 
void readAttributesBuffer (AttributesBuffer &buffer, uint64_t n)
 
void writeAttributesBuffer (const AttributesBuffer &buffer, uint64_t n, uint64_t from=0)
 
void copyAttributesBuffer (AttributesBuffer &dst, const AttributesBuffer &src, uint64_t n, uint64_t to=0, uint64_t from=0)
 
const std::vector< RecordFile > & attributeFiles () const
 
void range (size_t id, uint32_t &min, uint32_t &max)
 
void transform (double &x, double &y, double &z, const Point &pt) const
 
void transform (double &x, double &y, double &z, const uint8_t *buffer) const
 
void transformInvert (double &x, double &y, double &z) const
 

Static Public Member Functions

static void move (const std::string &outputPath, const std::string &inputPath)
 
static void remove (const std::string &path)
 
static void create (const std::string &path, const std::vector< LasFile::Point > &points, const std::array< double, 3 > scale={1, 1, 1}, const std::array< double, 3 > offset={0, 0, 0}, uint8_t version_minor=4)
 

Public Attributes

Header header
 

Static Public Attributes

static const uint32_t FORMAT_INVALID = 0
 
static const uint32_t FORMAT_XYZ = 1U << 1
 
static const uint32_t FORMAT_INTENSITY = 1U << 2
 
static const uint32_t FORMAT_CLASSIFICATION = 1U << 3
 
static const uint32_t FORMAT_RGB = 1U << 4
 
static const uint32_t FORMAT_SEGMENT = 1U << 5
 

Protected Member Functions

void readHeader (Header &hdr)
 
void writeHeader (const Header &hdr)
 
void openAttributeFiles (const std::string &path, bool truncate)
 
void openAttributeFile (RecordFile &file, const std::string &path, const std::string &name, RecordFile::Type recordType, bool truncate)
 

Protected Attributes

File file_
 
std::vector< RecordFileattributeFiles_
 

Member Enumeration Documentation

◆ Classification

LAS Classification.

Enumerator
CLASS_NEVER_CLASSIFIED 
CLASS_UNASSIGNED 
CLASS_GROUND 
CLASS_LOW_VEGETATION 
CLASS_MEDIUM_VEGETATION 
CLASS_HIGH_VEGETATION 
CLASS_BUILDING 

Constructor & Destructor Documentation

◆ LasFile()

LasFile::LasFile ( )

◆ ~LasFile()

LasFile::~LasFile ( )

Member Function Documentation

◆ attributeFiles()

const std::vector< RecordFile > & LasFile::attributeFiles ( ) const
inline

◆ close()

◆ copyAttributesBuffer()

void LasFile::copyAttributesBuffer ( AttributesBuffer & dst,
const AttributesBuffer & src,
uint64_t n,
uint64_t to = 0,
uint64_t from = 0 )

◆ create() [1/2]

void LasFile::create ( const std::string & path)

◆ create() [2/2]

void LasFile::create ( const std::string & path,
const std::vector< LasFile::Point > & points,
const std::array< double, 3 > scale = {1, 1, 1},
const std::array< double, 3 > offset = {0, 0, 0},
uint8_t version_minor = 4 )
static

◆ createAttributesBuffer()

void LasFile::createAttributesBuffer ( AttributesBuffer & buffer,
uint64_t n,
bool setZero = false )

◆ formatBytesToPoint()

void LasFile::formatBytesToPoint ( Point & pt,
const uint8_t * buffer ) const

Referenced by PageData::readPage(), and readPoint().

◆ formatPointToBytes()

void LasFile::formatPointToBytes ( uint8_t * buffer,
const Point & pt ) const

Referenced by writePoint().

◆ move()

void LasFile::move ( const std::string & outputPath,
const std::string & inputPath )
static

◆ offset()

uint64_t LasFile::offset ( ) const

◆ open() [1/2]

bool LasFile::open ( ) const

◆ open() [2/2]

void LasFile::open ( const std::string & path)

◆ openAttributeFile()

void LasFile::openAttributeFile ( RecordFile & file,
const std::string & path,
const std::string & name,
RecordFile::Type recordType,
bool truncate )
protected

Referenced by openAttributeFiles().

◆ openAttributeFiles()

void LasFile::openAttributeFiles ( const std::string & path,
bool truncate )
protected

Referenced by create(), and open().

◆ range()

void LasFile::range ( size_t id,
uint32_t & min,
uint32_t & max )

◆ readAttributesBuffer()

◆ readBuffer()

◆ readHeader() [1/2]

◆ readHeader() [2/2]

void LasFile::readHeader ( Header & hdr)
protected

◆ readPoint()

void LasFile::readPoint ( Point & pt)

◆ remove()

void LasFile::remove ( const std::string & path)
static

◆ seek()

void LasFile::seek ( uint64_t offset)

◆ seekExtendedVlr()

void LasFile::seekExtendedVlr ( )

◆ seekHeader()

void LasFile::seekHeader ( )

◆ seekPoint()

◆ seekPointData()

void LasFile::seekPointData ( )

◆ seekVlr()

void LasFile::seekVlr ( )

◆ size()

uint64_t LasFile::size ( ) const

◆ transform() [1/2]

void LasFile::transform ( double & x,
double & y,
double & z,
const Point & pt ) const

◆ transform() [2/2]

void LasFile::transform ( double & x,
double & y,
double & z,
const uint8_t * buffer ) const

◆ transformInvert()

void LasFile::transformInvert ( double & x,
double & y,
double & z ) const

◆ writeAttributesBuffer()

◆ writeBuffer()

◆ writeHeader() [1/2]

void LasFile::writeHeader ( )

◆ writeHeader() [2/2]

void LasFile::writeHeader ( const Header & hdr)
protected

◆ writePoint()

void LasFile::writePoint ( const Point & pt)

Member Data Documentation

◆ attributeFiles_

◆ file_

◆ FORMAT_CLASSIFICATION

const uint32_t LasFile::FORMAT_CLASSIFICATION = 1U << 3
static

◆ FORMAT_INTENSITY

const uint32_t LasFile::FORMAT_INTENSITY = 1U << 2
static

◆ FORMAT_INVALID

const uint32_t LasFile::FORMAT_INVALID = 0
static

LAS Attribute.

Referenced by ExportFileProperties::clear().

◆ FORMAT_RGB

const uint32_t LasFile::FORMAT_RGB = 1U << 4
static

◆ FORMAT_SEGMENT

const uint32_t LasFile::FORMAT_SEGMENT = 1U << 5
static

◆ FORMAT_XYZ

const uint32_t LasFile::FORMAT_XYZ = 1U << 1
static

◆ header


The documentation for this class was generated from the following files: