5 #include <pdal/PointViewIter.hpp> 6 #include <rialto/GeoPackageCommon.hpp> 25 m_inputFilename = db_name;
28 if (!m_inputFilename.ext().contains(
"gpkg"))
33 m_pdalOptions.add(
"filename", m_inputFilename.string());
34 m_pdalPipe =
new RialtoReader;
35 m_pdalOptions.add(
"verbose", LogLevel::Debug);
36 m_pdalPipe->setOptions(m_pdalOptions);
38 m_pdalPipe->prepare(*m_pointTable);
40 catch (std::exception& e)
59 "Rialto does not support file-based reads. Returning blank point block."<<endl;
70 double minx = bounds.
ul().
lon;
71 double maxx = bounds.
lr().
lon;
72 double miny = bounds.
lr().
lat;
73 double maxy = bounds.
ul().
lat;
74 BOX2D bbox_rect (minx, miny, maxx, maxy);
75 std::string bbox_name (
"bounds");
77 pdalOption.setName(bbox_name);
78 m_pdalOptions.remove(pdalOption);
79 m_pdalOptions.add(bbox_name, bbox_rect);
80 m_pdalPipe->setOptions(m_pdalOptions);
82 m_pdalPipe->prepare(*m_pointTable);
85 m_pvs = m_pdalPipe->execute(*m_pointTable);
89 PointViewSet::iterator pvs_iter = m_pvs.begin();
90 while (pvs_iter != m_pvs.end())
93 m_currentPV = *pvs_iter;
94 m_currentPvOffset = 0;
95 parsePointView(block);
105 if (!m_minRecord.valid())
111 m_availableFields = 0;
116 RialtoReader* reader = (RialtoReader*) m_pdalPipe;
117 const GpkgMatrixSet& info = reader->getMatrixSet();
118 const std::vector<GpkgDimension>& dimList = info.getDimensions();
119 std::vector<GpkgDimension>::const_iterator dim_iter = dimList.begin();
121 while (dim_iter != dimList.end())
123 double min_value = dim_iter->getMinimum();
124 double max_value = dim_iter->getMaximum();
129 minGpt.
lon = min_value;
130 maxGpt.
lon = max_value;
134 minGpt.
lat = min_value;
135 maxGpt.
lat = max_value;
139 minGpt.
hgt = min_value;
140 maxGpt.
hgt = max_value;
148 else if (dimName.
contains(
"ReturnNumber"))
154 else if (dimName.
contains(
"NumberOfReturns"))
178 else if (dimName.
contains(
"GpsTime"))
184 else if (dimName.
contains(
"Infrared"))
193 m_minRecord->setPosition(minGpt);
194 m_maxRecord->setPosition(maxGpt);
198 cout<<
"minPt: "<<*m_minRecord<<endl;
199 cout<<
"maxPt: "<<*m_maxRecord<<endl;
virtual void getFileBlock(ossim_uint32 offset, ossimPointBlock &block, ossim_uint32 np=0) const
Riaalto implementation does not support direct file reads, so this method is stubbed out with a warin...
virtual void establishMinMax()
Computes min and max records using points in the current PointViewSet.
std::shared_ptr< pdal::PointTable > PointTablePtr
bool contains(char aChar) const
virtual ~ossimRialtoReader()
virtual destructor
virtual bool open(const ossimFilename &fname)
Accepts filename of Rialto database file.
ossim_float64 hgt
Height in meters above the ellipsiod.
virtual void clear()
Resets any storage to empty.
unsigned int ossim_uint32
const ossimGpt & ul() const
ossimRialtoReader()
default constructor
#define RTTI_DEF1(cls, name, b1)
const ossimGpt & lr() const
virtual void getBlock(const ossimGrect &bounds, ossimPointBlock &block) const
Fetches the block of points inside the block bounds.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)