Skip to content

Commit

Permalink
Merge pull request #492 from chambbj/issues/489-windows-round
Browse files Browse the repository at this point in the history
use Utils::sround rather than std::round to fix #489
  • Loading branch information
hobu committed Sep 25, 2014
2 parents 0b89878 + 2fd413a commit da4b017
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/QuadIndex.cpp
Expand Up @@ -38,6 +38,7 @@

#include <pdal/QuadIndex.hpp>
#include <pdal/PointBuffer.hpp>
#include <pdal/Utils.hpp>

namespace pdal
{
Expand Down Expand Up @@ -334,12 +335,12 @@ void Tree::getPoints(
if (data)
{
const std::size_t xOffset(
std::round((bbox.center.x - xBegin) / xStep));
Utils::sround((bbox.center.x - xBegin) / xStep));
const double yOffset(
std::round((bbox.center.y - yBegin) / yStep));
Utils::sround((bbox.center.y - yBegin) / yStep));

const std::size_t index(
std::round(yOffset * (xEnd - xBegin) / xStep + xOffset));
Utils::sround(yOffset * (xEnd - xBegin) / xStep + xOffset));

results.at(index) = data->pbIndex;
}
Expand Down

0 comments on commit da4b017

Please sign in to comment.