OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Public Member Functions | Private Member Functions | List of all members
ossimPdalFileReader Class Reference

#include <ossimPdalFileReader.h>

Inheritance diagram for ossimPdalFileReader:
ossimPdalReader ossimPointCloudHandler ossimPointCloudSource ossimSource ossimConnectableObject ossimErrorStatusInterface ossimObject ossimListenerManager ossimPropertyInterface ossimReferenced

Public Member Functions

 ossimPdalFileReader ()
 default constructor More...
 
virtual ~ossimPdalFileReader ()
 virtual destructor More...
 
virtual bool open (const ossimFilename &fname)
 Accepts the name of a point cloud file. More...
 
virtual void getFileBlock (ossim_uint32 offset, ossimPointBlock &block, ossim_uint32 maxNumPoints=0xFFFFFFFF) const
 Fetches up to maxNumPoints points at the given dataset <offset> in the order they appear in the data file. More...
 
virtual ossim_uint32 getNumPoints () const
 Returns number of points in the data file. More...
 
- Public Member Functions inherited from ossimPdalReader
 ossimPdalReader ()
 default constructor More...
 
virtual ~ossimPdalReader ()
 virtual destructor More...
 
virtual void rewind () const
 
virtual void close ()
 Closes the point cloud file(s). More...
 
virtual ossim_uint32 getFieldCode () const
 Fetches the data fields ids available from this source, OR'd together for testing against specific field (. More...
 
virtual void setFieldCode (ossim_uint32 fieldCode)
 Sets the data fields ID of interest for this source, and all input sources connected to this. More...
 
- Public Member Functions inherited from ossimPointCloudHandler
 ossimPointCloudHandler ()
 
 ossimPointCloudHandler (ossimObject *owner)
 
virtual ~ossimPointCloudHandler ()
 
virtual void getNextFileBlock (ossimPointBlock &block, ossim_uint32 maxNumPoints=0xFFFFFFFF) const
 
virtual void getBlock (const ossimGrect &bounds, ossimPointBlock &block) const
 Fetches the block of points inside the block bounds. More...
 
virtual const ossimPointRecordgetMinPoint () const
 Assigns the two points with fields representing the extremes of the dataset. More...
 
virtual const ossimPointRecordgetMaxPoint () const
 
virtual void getBounds (ossimGrect &bounds) const
 
virtual bool canConnectMyInputTo (ossim_int32, const ossimConnectableObject *) const
 Handler is always on the start of the pipeline. More...
 
void normalizeBlock (ossimPointBlock &block)
 
- Public Member Functions inherited from ossimPointCloudSource
 ossimPointCloudSource (ossimObject *owner=0)
 
virtual ~ossimPointCloudSource ()
 
virtual bool hasFields (ossim_uint32 id) const
 Returns true if the data field is available from this source. More...
 
bool hasRGB () const
 Special for convenience. More...
 
- Public Member Functions inherited from ossimSource
 ossimSource (ossimObject *owner=0)
 
 ossimSource (ossimObject *owner, ossim_uint32 inputListSize, ossim_uint32 outputListSize, bool inputListIsFixedFlag=true, bool outputListIsFixedFlag=true)
 
virtual ~ossimSource ()
 
virtual bool isSourceEnabled () const
 
virtual void enableSource ()
 
virtual void disableSource ()
 
virtual bool getEnableFlag () const
 
virtual void setEnableFlag (bool flag)
 
virtual bool isInitialized () const
 
virtual void setInitializedFlag (bool flag)
 
virtual void initialize ()
 
virtual void setProperty (ossimRefPtr< ossimProperty > property)
 
virtual ossimRefPtr< ossimPropertygetProperty (const ossimString &name) const
 
virtual void getPropertyNames (std::vector< ossimString > &propertyNames) const
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 
virtual std::ostream & print (std::ostream &out) const
 Outputs theErrorStatus as an ossimErrorCode and an ossimString. More...
 
- Public Member Functions inherited from ossimConnectableObject
 ossimConnectableObject (ossimObject *owner=0)
 Base constructor of this object. More...
 
 ossimConnectableObject (ossimObject *owner, ossim_int32 inputListSize, ossim_int32 outputListSize, bool inputListIsFixedFlag=true, bool outputListIsFixedFlag=true)
 
virtual ~ossimConnectableObject ()
 
void setId (const ossimId &id)
 All connectable objects will have id's. More...
 
const ossimIdgetId () const
 Will allow us to get this object's id. More...
 
const ossimObjectgetOwner () const
 Fetches the current owner, most likely a container but not limited to one. More...
 
virtual void changeOwner (ossimObject *owner)
 Permits changing the object's owner. More...
 
virtual void setDescription (const ossimString &description)
 
virtual ossimString getDescription () const
 
virtual bool isConnected (ossimConnectableObjectDirectionType direction=CONNECTABLE_DIRECTION_INPUT) const
 will check the direction specified to see if all slots are full. More...
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject *findConnectableObject(const ossimId &id))
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject *findObjectOfType(RTTItypeid typeId, ossimConnectableObjectDirectionType directionType, bool recurse=true))
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject *findObjectOfType(const ossimString &obj, ossimConnectableObjectDirectionType directionType, bool recurse=true))
 
 OSSIM_DEPRECATE_METHOD (virtual ossimConnectableObject *findInputObjectOfType(const ossimString &className))
 
virtual ossim_int32 findInputIndex (const ossimConnectableObject *object)
 Return a valid index of the input list if the passed in object is found else return -1. More...
 
virtual ossim_int32 findInputIndex (const ossimId &id)
 Return a valid index of the input list if the passed id is found else return -1. More...
 
virtual ossim_int32 findOutputIndex (const ossimConnectableObject *object)
 Return a valid index of the output list if the passed in object is found else return -1. More...
 
virtual ossim_int32 findOutputIndex (const ossimId &id)
 Return a valid index of the output list if the passed in object is found else return -1. More...
 
virtual ossim_int32 getMyInputIndexToConnectTo (ossimConnectableObject *object) const
 Should return the first available index to connect to. More...
 
virtual ossim_int32 getMyOutputIndexToConnectTo (ossimConnectableObject *object) const
 Should return the first available index to connect to. More...
 
virtual bool canConnectMyOutputTo (ossim_int32 myOutputIndex, const ossimConnectableObject *object) const
 default implementation is to allow anyone to connect to us. More...
 
virtual void disconnect (ossimConnectableObject *object=0)
 Will disconnect the object passed in. More...
 
virtual void disconnect (const ossimId &id)
 Will disconnect the object passed in. More...
 
virtual ossimRefPtr< ossimConnectableObjectdisconnectMyInput (ossim_int32 inputIndex, bool disconnectOutputFlag=true, bool createEventFlag=true)
 Will disconnect the object at the given input index and generate a connection event. More...
 
virtual void disconnectMyInput (ossimConnectableObject *input, bool disconnectOutputFlag=true, bool createEventFlag=true)
 Finds the index of the passed in input and calls disconnectMyInput(inputIndex, disconnectOutputFlag, createEventFlag);. More...
 
virtual void disconnectMyInputs (ConnectableObjectList &inputList, bool disconnectOutputFlag=true, bool createEventFlag=true)
 
virtual ossimRefPtr< ossimConnectableObjectdisconnectMyOutput (ossim_int32 outputIndex, bool disconnectInputFlag=true, bool createEventFlag=true)
 Will disconnect the object at the given output index and generate a connection event. More...
 
virtual void disconnectMyOutput (ossimConnectableObject *output, bool disconnectInputFlag=true, bool createEventFlag=true)
 Will disconnect the output object. More...
 
virtual void disconnectMyOutputs (ConnectableObjectList &outputList, bool disconnectOutputFlag=true, bool createEventFlag=true)
 
virtual void disconnectAllInputs ()
 Will disconnect all of the input objects. More...
 
virtual void disconnectAllOutputs ()
 Will disconnect all of the output objects. More...
 
virtual ossim_int32 connectMyInputTo (ossimConnectableObject *inputObject, bool makeOutputConnection=true, bool createEventFlag=true)
 Will try to connect this objects input to the passed in object. More...
 
virtual ossim_int32 connectMyInputTo (ossim_int32 inputIndex, ossimConnectableObject *inputObject, bool makeOutputConnection=true, bool createEventFlag=true)
 Will connect the specified input to the passed in object. More...
 
virtual bool connectMyInputTo (ConnectableObjectList &inputList, bool makeOutputConnection=true, bool createEventFlag=true)
 
virtual ossim_int32 connectMyOutputTo (ossimConnectableObject *outputObject, bool makeInputConnection=true, bool createEventFlag=true)
 Will try to connect this objects output to the passed in object. More...
 
virtual bool connectMyOutputTo (ConnectableObjectList &outputList, bool makeInputConnection=true, bool createEventFlag=true)
 
virtual bool connectInputList (ConnectableObjectList &inputList)
 Will disconnect itself from all inputs and reset to the passed in input list. More...
 
virtual bool connectOutputList (ConnectableObjectList &outputList)
 Will disconnect itself from all outputs and reset to the passed in output list. More...
 
virtual ossim_uint32 getNumberOfInputs () const
 Returns the number of input objects. More...
 
virtual ossim_uint32 getNumberOfOutputs () const
 Return the number of output objects. More...
 
ossimConnectableObjectgetInput (ossim_uint32 index=0)
 returns the object at the specified index. More...
 
const ossimConnectableObjectgetInput (ossim_uint32 index=0) const
 returns the object at the specified index. More...
 
ossimConnectableObjectgetOutput (ossim_uint32 index=0)
 returns the object at the specified index. More...
 
const ossimConnectableObjectgetOutput (ossim_uint32 index=0) const
 returns the object at the specified index. More...
 
virtual void setNumberOfInputs (ossim_int32 numberOfInputs)
 Will set the number of inputs. More...
 
virtual bool getInputListIsFixedFlag () const
 
virtual bool getOutputListIsFixedFlag () const
 
virtual void setNumberOfOutputs (ossim_int32 numberOfInputs)
 Will set the number of outputs. More...
 
const ConnectableObjectListgetInputList () const
 
const ConnectableObjectListgetOutputList () const
 
ConnectableObjectListgetInputList ()
 
ConnectableObjectListgetOutputList ()
 
 OSSIM_DEPRECATE_METHOD (virtual void findAllObjectsOfType(ConnectableObjectList &result, const RTTItypeid &typeInfo, bool recurse=true))
 
 OSSIM_DEPRECATE_METHOD (virtual void findAllObjectsOfType(ConnectableObjectList &result, const ossimString &className, bool recurse=true))
 
virtual void propagateEventToOutputs (ossimEvent &event)
 
virtual void propagateEventToInputs (ossimEvent &event)
 
virtual void setProperty (const ossimString &name, const ossimString &value)
 
virtual ossim_uint32 saveStateOfAllInputs (ossimKeywordlist &kwl, bool saveThisStateFlag=true, ossim_uint32 objectIndex=1, const char *prefix=0) const
 Save the state of all inputs to a keyword list. More...
 
virtual bool fillContainer (ossimConnectableContainer &container)
 Inserts this object and all of its children and inputs into the container provided. More...
 
bool moveInputUp (const ossimId &id)
 Moves the input connection matching id up one in the connection list. More...
 
bool moveInputDown (const ossimId &id)
 Moves the input connection matching id down one in the connection list. More...
 
bool moveInputToTop (const ossimId &id)
 Moves the input connection matching id to the top of the connection list. More...
 
bool moveInputToBottom (const ossimId &id)
 Moves the input connection matching id to the bottom of the connection list. More...
 
virtual void accept (ossimVisitor &visitor)
 We will add a visitor interface for all connectable objects. More...
 
- Public Member Functions inherited from ossimObject
 ossimObject ()
 
virtual ~ossimObject ()
 
virtual ossimObjectdup () const
 
virtual ossimString getShortName () const
 
virtual ossimString getLongName () const
 
virtual ossimString getClassName () const
 
virtual RTTItypeid getType () const
 
virtual bool canCastTo (ossimObject *obj) const
 
virtual bool canCastTo (const RTTItypeid &id) const
 
virtual bool canCastTo (const ossimString &parentClassName) const
 
virtual bool isEqualTo (const ossimObject &obj, ossimCompareType compareType=OSSIM_COMPARE_FULL) const
 
- Public Member Functions inherited from ossimReferenced
 ossimReferenced ()
 
 ossimReferenced (const ossimReferenced &)
 
ossimReferencedoperator= (const ossimReferenced &)
 
void ref () const
 increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
void unref () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unref_nodelete () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
int referenceCount () const
 
- Public Member Functions inherited from ossimListenerManager
 ossimListenerManager ()
 
virtual ~ossimListenerManager ()
 
virtual void fireEvent (ossimEvent &event)
 
virtual bool addListener (ossimListener *listener)
 
virtual bool removeListener (ossimListener *listener)
 
virtual bool findListener (ossimListener *listener)
 
- Public Member Functions inherited from ossimPropertyInterface
 ossimPropertyInterface ()
 
virtual ~ossimPropertyInterface ()
 
virtual ossimString getPropertyValueAsString (const ossimString &name) const
 
void getPropertyList (std::vector< ossimRefPtr< ossimProperty > > &propertyList) const
 
void setProperties (std::vector< ossimRefPtr< ossimProperty > > &propertyList)
 
- Public Member Functions inherited from ossimErrorStatusInterface
 ossimErrorStatusInterface ()
 
virtual ~ossimErrorStatusInterface ()
 
virtual ossimErrorCode getErrorStatus () const
 
virtual ossimString getErrorStatusString () const
 
virtual void setErrorStatus (ossimErrorCode error_status) const
 
virtual void setErrorStatus () const
 
virtual void clearErrorStatus () const
 
bool hasError () const
 

Private Member Functions

virtual void establishMinMax ()
 Computes min and max records using points in the current PointViewSet. More...
 

Additional Inherited Members

- Public Types inherited from ossimConnectableObject
enum  ossimConnectableObjectDirectionType { CONNECTABLE_DIRECTION_NONE = 0, CONNECTABLE_DIRECTION_INPUT = 1, CONNECTABLE_DIRECTION_OUTPUT = 2 }
 
typedef std::vector< ossimRefPtr< ossimConnectableObject > > ConnectableObjectList
 
- Static Public Attributes inherited from ossimPointCloudHandler
static ossim_uint32 DEFAULT_BLOCK_SIZE = 0x400000
 
- Protected Member Functions inherited from ossimPdalReader
void parsePointView (ossimPointBlock &block, ossim_uint32 maxNumPoints=0xFFFFFFFF) const
 The current point ID (pid) gets updated. More...
 
void parsePoint (ossimPointRecord *precord) const
 Need to pass allocated ossimPointRecord with field code set to desired fields. More...
 
virtual void establishAvailableFields ()
 
- Protected Member Functions inherited from ossimPointCloudSource
 ossimPointCloudSource (const ossimPointCloudSource &rhs)
 
- Protected Member Functions inherited from ossimSource
 ossimSource (const ossimSource &rhs)
 
const ossimSourceoperator= (const ossimSource &rhs)
 
- Protected Member Functions inherited from ossimConnectableObject
ossimConnectableObjectfindObjectOfType (ConnectableObjectList *connectableList, ossimVisitor &visitor)
 
- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 
- Protected Member Functions inherited from ossimListenerManager
 ossimListenerManager (const ossimListenerManager &rhs)
 
- Protected Attributes inherited from ossimPdalReader
pdal::PointViewSet m_pvs
 
pdal::PointViewPtr m_currentPV
 
ossim_uint32 m_currentPvOffset
 
PointTablePtr m_pointTable
 
pdal::Stage * m_pdalPipe
 
pdal::Options m_pdalOptions
 
ossim_uint32 m_availableFields
 
- Protected Attributes inherited from ossimPointCloudHandler
ossimFilename m_inputFilename
 
ossimRefPtr< ossimPointCloudGeometrym_geometry
 
ossimRefPtr< ossimPointRecordm_minRecord
 
ossimRefPtr< ossimPointRecordm_maxRecord
 
ossim_uint32 m_currentPID
 
- Protected Attributes inherited from ossimPointCloudSource
ossimPointRecord m_nullPCR
 
- Protected Attributes inherited from ossimSource
bool theEnableFlag
 
bool theInitializedFlag
 
- Protected Attributes inherited from ossimConnectableObject
ossimId theId
 
ossimString theDescription
 
ossimObjecttheOwner
 
bool theInputListIsFixedFlag
 Indicates whether the theInputObjectList is fixed. More...
 
bool theOutputListIsFixedFlag
 Indicates whether the theOutputObjectList is fixed. More...
 
ConnectableObjectList theInputObjectList
 Holds a list of input objects. More...
 
ConnectableObjectList theOutputObjectList
 Holds a list of output objects. More...
 
- Protected Attributes inherited from ossimListenerManager
std::list< ossimListener * > theListenerList
 
bool theEnabledFlag
 
std::list< ossimListener * > theDelayedAdd
 
std::list< ossimListener * > theDelayedRemove
 
bool theFireEventFlag
 
- Protected Attributes inherited from ossimErrorStatusInterface
ossimErrorCode theErrorStatus
 

Detailed Description

Definition at line 22 of file ossimPdalFileReader.h.

Constructor & Destructor Documentation

◆ ossimPdalFileReader()

ossimPdalFileReader::ossimPdalFileReader ( )

default constructor

Definition at line 28 of file ossimPdalFileReader.cpp.

29 {
30 }

◆ ~ossimPdalFileReader()

ossimPdalFileReader::~ossimPdalFileReader ( )
virtual

virtual destructor

Definition at line 33 of file ossimPdalFileReader.cpp.

34 {
35 }

Member Function Documentation

◆ establishMinMax()

void ossimPdalFileReader::establishMinMax ( )
privatevirtual

Computes min and max records using points in the current PointViewSet.

Reimplemented from ossimPdalReader.

Definition at line 136 of file ossimPdalFileReader.cpp.

References ossimPointRecord::Blue, ossimPdalReader::establishMinMax(), ossimPointRecord::GpsTime, ossimPointRecord::Green, ossimPointRecord::Infrared, ossimPointRecord::Intensity, ossimPointRecord::NumberOfReturns, ossimPointRecord::Red, ossimPointRecord::ReturnNumber, ossimDpt3d::x, ossimDpt3d::y, and ossimDpt3d::z.

137 {
138  if (!m_pdalPipe || !m_currentPV || !m_geometry.valid())
139  return;
140 
141 #define USE_STATS_FILTER
142 #ifdef USE_STATS_FILTER
143 
144  if (!m_minRecord.valid())
145  {
148  }
149 
150  // Attempt to cast down to a stats filter for faster min/max access:
151  ossimString filterName(m_pdalPipe->getName());
152  if (!filterName.contains("filters.stats"))
153  {
155  return;
156  }
157  pdal::StatsFilter* stats = (pdal::StatsFilter*) m_pdalPipe;
158 
159  // The ossimPointRecord should already be initialized with the desired fields set to default
160  // values (i.e., their NULL values):
161  ossimDpt3d minPt, maxPt;
162  const IdList& idList = m_currentPV->dims();
163  IdList::const_iterator dim_iter = idList.begin();
164  while (dim_iter != idList.end())
165  {
166  Id::Enum id = *dim_iter;
167  const stats::Summary& summary = stats->getStats(id);
168 
169  switch (id)
170  {
171  case Id::Enum::X: // always do position
172  minPt.x = summary.minimum();
173  maxPt.x = summary.maximum();
174  break;
175  case Id::Enum::Y: // always do position
176  minPt.y = summary.minimum();
177  maxPt.y = summary.maximum();
178  break;
179  case Id::Enum::Z: // always do position
180  minPt.z = summary.minimum();
181  maxPt.z = summary.maximum();
182  break;
183  case Id::Enum::ReturnNumber:
185  {
188  }
189  break;
190  case Id::Enum::NumberOfReturns:
192  {
195  }
196  break;
197  case Id::Enum::Intensity:
199  {
202  }
203  break;
204  case Id::Enum::Red:
206  {
209  }
210  break;
211  case Id::Enum::Green:
213  {
216  }
217  break;
218  case Id::Enum::Blue:
220  {
223  }
224  break;
225  case Id::Enum::Infrared:
227  {
230  }
231  break;
232  case Id::Enum::GpsTime:
234  {
237  }
238  break;
239  default:
240  break;
241  }
242  ++dim_iter;
243  }
244 
245  // Need to convert X, Y, Z to geographic point (if necessary).
246  ossimGpt min_gpt, max_gpt;
247  m_geometry->convertPos(minPt, min_gpt);
248  m_minRecord->setPosition(min_gpt);
249  m_geometry->convertPos(maxPt, max_gpt);
250  m_maxRecord->setPosition(max_gpt);
251 
252 #else
253 
255 
256 #endif
257 
258 }
ossimRefPtr< ossimPointRecord > m_maxRecord
pdal::Stage * m_pdalPipe
bool valid() const
Definition: ossimRefPtr.h:75
float ossim_float32
pdal::PointViewPtr m_currentPV
virtual ossim_uint32 getFieldCode() const
Fetches the data fields ids available from this source, OR&#39;d together for testing against specific fi...
double z
Definition: ossimDpt3d.h:145
void convertPos(const ossimDpt3d &stored_pos, ossimGpt &converted_gpos) const
Method converts a generic 3D point as stored in the argument ossim3Dpt object, and converts it to an ...
double x
Definition: ossimDpt3d.h:143
virtual void establishMinMax()
Computes min and max records using points in the current PointViewSet.
void setField(FIELD_CODES fc, ossim_float32 value)
double y
Definition: ossimDpt3d.h:144
ossimRefPtr< ossimPointCloudGeometry > m_geometry
void setPosition(const ossimGpt &p)
ossimRefPtr< ossimPointRecord > m_minRecord
virtual bool hasFields(ossim_uint32 id) const
Returns true if the data field is available from this source.

◆ getFileBlock()

void ossimPdalFileReader::getFileBlock ( ossim_uint32  offset,
ossimPointBlock block,
ossim_uint32  maxNumPoints = 0xFFFFFFFF 
) const
virtual

Fetches up to maxNumPoints points at the given dataset <offset> in the order they appear in the data file.

Thread-safe implementation accepts a previously-allocated vector from the caller. The offset is set to offset + block.size (or EOF) upon exit, to permit sequencing with getNextBlock() implmented in base class.

Implements ossimPointCloudHandler.

Definition at line 111 of file ossimPdalFileReader.cpp.

References ossimPointBlock::clear().

114 {
115  // A single input file means a single point view coming out of the manager:
116  if (!m_currentPV)
117  {
118  block.clear();
119  return;
120  }
121 
122  ossim_uint32 numPoints = m_currentPV->size();
123 
124  // Expecting the block object passed in to have been allocated to the desired block size before
125  // this call. Interpreting a size = 0 to mean do nothing:
126  if ((requested == 0) || (offset >= numPoints))
127  {
128  block.clear();
129  return;
130  }
131 
132  m_currentPID = offset;
133  parsePointView(block, requested);
134 }
pdal::PointViewPtr m_currentPV
void parsePointView(ossimPointBlock &block, ossim_uint32 maxNumPoints=0xFFFFFFFF) const
The current point ID (pid) gets updated.
virtual void clear()
Resets any storage to empty.
unsigned int ossim_uint32

◆ getNumPoints()

ossim_uint32 ossimPdalFileReader::getNumPoints ( ) const
virtual

Returns number of points in the data file.

Reimplemented from ossimPdalReader.

Definition at line 102 of file ossimPdalFileReader.cpp.

103 {
104  if (!m_currentPV)
105  return 0;
106 
107  return m_currentPV->size();
108 }
pdal::PointViewPtr m_currentPV

◆ open()

bool ossimPdalFileReader::open ( const ossimFilename fname)
virtual

Accepts the name of a point cloud file.

Returns TRUE if successful.

Implements ossimPointCloudHandler.

Definition at line 37 of file ossimPdalFileReader.cpp.

Referenced by test_pdal().

38 {
39  // PDAL opens the file here.
40  m_inputFilename = fname;
41  pdal::Stage* reader = 0;
42  try
43  {
44  if (m_inputFilename.contains("fauxreader"))
45  {
46  // Debug generated image:
47  reader = new FauxReader;
48  m_pdalPipe = reader;
49  m_pdalOptions.add("mode", "ramp");
50  BOX3D bbox(-0.001, -0.001, -100.0, 0.001, 0.001, 100.0);
51  m_pdalOptions.add("bounds", bbox);
52  m_pdalOptions.add("num_points", "11");
53  m_pdalPipe->setOptions(m_pdalOptions);
54  }
55  else
56  {
57  StageFactory factory;
58  const string driver = factory.inferReaderDriver(m_inputFilename.string());
59  if (driver == "")
60  throw pdal_error("File type not supported by PDAL");
61  reader = factory.createStage(driver);
62  if (!reader)
63  throw pdal_error("No reader created by PDAL");
64 
65  m_pdalOptions.add("filename", m_inputFilename.string());
66  reader->setOptions(m_pdalOptions);
67 
68  // Stick a stats filter in the pipeline:
69  m_pdalPipe = new StatsFilter();
70  m_pdalPipe->setInput(*reader);
71  }
72 
73  m_pointTable = PointTablePtr(new PointTable);
74  m_pdalPipe->prepare(*m_pointTable);
75  m_pvs = m_pdalPipe->execute(*m_pointTable);
76  if (!m_pvs.empty())
77  {
78  m_currentPV = *(m_pvs.begin());
79 
80  // Determine available data fields:
82  }
83 
84  std::string wkt;
85  const SpatialReference& srs = reader->getSpatialReference();
86  wkt = srs.getWKT(SpatialReference::eCompoundOK, false);
88  }
89  catch (std::exception& e)
90  {
91  //ossimNotify() << e.what() << endl;
92  return false;
93  }
94 
95  // Establish the bounds (geographic & radiometric). These are stored in two extreme point records
96  // maintained by the base class:
98 
99  return true;
100 }
pdal::Options m_pdalOptions
pdal::Stage * m_pdalPipe
std::shared_ptr< pdal::PointTable > PointTablePtr
bool contains(char aChar) const
Definition: ossimString.h:58
pdal::PointViewPtr m_currentPV
virtual void establishAvailableFields()
PointTablePtr m_pointTable
ossimRefPtr< ossimPointCloudGeometry > m_geometry
virtual void establishMinMax()
Computes min and max records using points in the current PointViewSet.
pdal::PointViewSet m_pvs
const std::string & string() const
Definition: ossimString.h:414

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