From 2fd413af2d648db8354bc29fa3a7392b000fa5e2 Mon Sep 17 00:00:00 2001 From: Bradley J Chambers Date: Thu, 25 Sep 2014 09:59:37 -0400 Subject: [PATCH] use Utils::sround rather than std::round to fix #489 --- src/QuadIndex.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/QuadIndex.cpp b/src/QuadIndex.cpp index 7d058c48bd..f16745dca3 100644 --- a/src/QuadIndex.cpp +++ b/src/QuadIndex.cpp @@ -38,6 +38,7 @@ #include #include +#include namespace pdal { @@ -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; }