Skip to content

Commit

Permalink
guard for situations when we don't have GPStime stats (#96)
Browse files Browse the repository at this point in the history
* guard for situations when we don't have GPStime stats

* init gps stats
  • Loading branch information
hobu authored Nov 30, 2021
1 parent ddcac51 commit 0f65198
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions bu/CopcSupport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,14 @@ void CopcSupport::updateHeader(const StatsMap& stats)
m_header.minx = stats.at(Id::X).minimum();
m_header.miny = stats.at(Id::Y).minimum();
m_header.minz = stats.at(Id::Z).minimum();
m_copcVlr.gpstime_minimum = stats.at(Id::GpsTime).minimum();
m_copcVlr.gpstime_maximum = stats.at(Id::GpsTime).maximum();

m_copcVlr.gpstime_minimum = 0.0f;
m_copcVlr.gpstime_maximum = 0.0f;
if (stats.count(Id::GpsTime))
{
m_copcVlr.gpstime_minimum = stats.at(Id::GpsTime).minimum();
m_copcVlr.gpstime_maximum = stats.at(Id::GpsTime).maximum();
}

for (int i = 1; i <= 15; ++i)
{
Expand Down

0 comments on commit 0f65198

Please sign in to comment.