PointSource Class Reference

PointSource is the base class of LiDAR point cloud extraction pipeline. More...

#include <PointSource.h>

Inheritance diagram for PointSource:

Object PointReader MG4PointReader TXTPointReader

List of all members.

Public Types

typedef lt_int64 count_type

Public Member Functions

virtual const PointInfogetPointInfo (void) const =0
 Get the point information.
size_t getNumChannels (void) const
 Get the number of channels.
bool hasChannel (const char *name) const
 Determine if there is a channel with a given name.
const ChannelInfogetChannel (size_t idx) const
 Access the channel info.
const ChannelInfogetChannel (const char *name) const
 Access the channel data.
virtual count_type getNumPoints (void) const =0
 Get the number of points.
virtual const char * getWKT (void) const =0
 Get the spatial reference system.
virtual void loadMetadata (Metadata &metadata, bool sanitize) const =0
 Load the point clouds metadata.
virtual const BoundsgetBounds (void) const =0
 Get the bounding box.
virtual const double * getScale (void) const =0
 Get the quantization scale.
virtual const double * getOffset (void) const =0
 Get the quantization offset.
virtual size_t getNumClassIdNames (void) const =0
 Get the number of classification names.
virtual char const *const * getClassIdNames (void) const =0
 Get the classification names.
virtual double getTotalWork (const Bounds &bounds, double fraction) const =0
 Get the amount of work needed to decode bounds.
virtual PointIteratorcreateIterator (const Bounds &bounds, double fraction, const PointInfo &pointInfo, ProgressDelegate *delegate) const =0
 Get a PointIterator for a given bounds.
size_t read (const Bounds &bounds, PointData &points, ProgressDelegate *delegate) const
 Fill the point buffer with the best sample of the point cloud in bounds.


Detailed Description

The PointSource class the base class for accessing LiDAR data. PointSource has two types of methods. The first class are methods that report bulk properties of the point cloud, such as number of points and number of channels. The second class of methods give access to the point cloud itself, see createIterator() and read().

Note:
All methods are const, so you should be able to use this Object on multiple threads at a time. The decode state lives in the PointIterator so only one thread can use a PointIterator.
See also:
See examples/src/DumpMG4Info.cpp dumpHeader() for an example of accessing bulk properties of the point cloud.

See examples/src/UserTutorial.cpp for examples of accessing the point cloud.

Definition at line 40 of file PointSource.h.


Member Typedef Documentation

Definition at line 44 of file PointSource.h.


Member Function Documentation

virtual const PointInfo& PointSource::getPointInfo ( void   )  const [pure virtual]

This method returns a PointInfo object.

Implemented in PointReader.

size_t PointSource::getNumChannels ( void   )  const

This method returns the channels. This method is equivalent to calling getPointInfo().getNumChannels().

bool PointSource::hasChannel ( const char *  name  )  const

The method determines if this source has a channel with the given name.

Parameters:
name the channel name
Returns:
true if the channel was found

const ChannelInfo& PointSource::getChannel ( size_t  idx  )  const

This method returns the ChannelInfo for a given index.

Parameters:
idx the index of the wanted channel
Returns:
the channel info for the given channel
Note:
This method is equivalent to calling getPointInfo().getChannel(idx).

const ChannelInfo* PointSource::getChannel ( const char *  name  )  const

This method returns the ChannelInfo for a given name.

Parameters:
name the name of the wanted channel
Returns:
the channel data for the given channel
Note:
This method is equivalent to calling getPointInfo().getChannel(name).

virtual count_type PointSource::getNumPoints ( void   )  const [pure virtual]

This method returns the number of points in the point cloud.

Implemented in PointReader.

virtual const char* PointSource::getWKT ( void   )  const [pure virtual]

This method returns the spatial reference system as a Well Known Text (WKT) string. If the PointSource does not have a spatial reference system it will return NULL.

Implemented in PointReader.

virtual void PointSource::loadMetadata ( Metadata metadata,
bool  sanitize 
) const [pure virtual]

This method loads the metadata for the point cloud. PointSource only load metadata on demand to reduce memory usage.

Parameters:
metadata The metadata object to fill.
sanitize If true remove vendor-specific metadata that we don't understand for example, Merrick::102 ("Index to page of point records")

Implemented in MG4PointReader, and TXTPointReader.

virtual const Bounds& PointSource::getBounds ( void   )  const [pure virtual]

This method returns the geo bounding box of the point cloud.

Implemented in PointReader.

virtual const double* PointSource::getScale ( void   )  const [pure virtual]

This method returns the quantization scale factors for X, Y, and Z channels. It returns NULL then the point cloud is not quantized or quantization is unknown.

Implemented in PointReader.

virtual const double* PointSource::getOffset ( void   )  const [pure virtual]

This method returns the quantization offset for X, Y, and Z channels. It returns NULL then the point cloud is not quantized or quantization is unknown.

Implemented in PointReader.

virtual size_t PointSource::getNumClassIdNames ( void   )  const [pure virtual]

This methods returns the number of classification names.

Implemented in MG4PointReader, and PointReader.

virtual char const* const* PointSource::getClassIdNames ( void   )  const [pure virtual]

This methods returns an array of classification names with length getNumClassIdNames().

Implemented in MG4PointReader, and PointReader.

virtual double PointSource::getTotalWork ( const Bounds bounds,
double  fraction 
) const [pure virtual]

This method returns the amount of work needed to decode the points in bounds. getTotalWork() is used with ProgressDelegate to track the progress of a decode or encode.

Parameters:
bounds the region of interest
fraction the fraction of the points you want (use 1.0 for all the points and use 0.1 to keep every tenth point)
Returns:
the work needed to decode bounds

Implemented in MG4PointReader, PointReader, and TXTPointReader.

virtual PointIterator* PointSource::createIterator ( const Bounds bounds,
double  fraction,
const PointInfo pointInfo,
ProgressDelegate delegate 
) const [pure virtual]

This methods returns a PointIterator for the given bounds.

Parameters:
bounds the region of interest (HUGE_VAL are handled)
fraction the fraction of the points you want (use 1.0 for all the points and use 0.1 to keep every tenth point)
channelInfo the list of channels to be extracted
numChannels the number of channels to be extracted
delegate a ProgressDelegate for feedback (can be NULL)

Implemented in MG4PointReader, and TXTPointReader.

size_t PointSource::read ( const Bounds bounds,
PointData points,
ProgressDelegate delegate 
) const

Parameters:
bounds the region of interest
points the destination point buffer
delegate a ProgressDelegate for feedback (can be NULL)
Returns:
the number of points written into the destination point buffer


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

LizardTech