Skip to content

Commit

Permalink
fix twisted conversion, fixes #1000
Browse files Browse the repository at this point in the history
  • Loading branch information
DennisOSRM committed May 2, 2014
1 parent b5c095d commit f14164a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Algorithms/DouglasPeucker.cpp
Expand Up @@ -60,6 +60,8 @@ static double DouglasPeuckerThresholds[19] = {262144., // z0

void DouglasPeucker::Run(std::vector<SegmentInformation> &input_geometry, const unsigned zoom_level)
{

unsigned counter = 2;
{
BOOST_ASSERT_MSG(zoom_level < 19, "unsupported zoom level");
BOOST_ASSERT_MSG(1 < input_geometry.size(), "geometry invalid");
Expand Down Expand Up @@ -95,7 +97,7 @@ void DouglasPeucker::Run(std::vector<SegmentInformation> &input_geometry, const
// find index idx of element with max_distance
for (unsigned i = pair.first + 1; i < pair.second; ++i)
{
const int temp_dist = FixedPointCoordinate::ComputePerpendicularDistance(
const double temp_dist = FixedPointCoordinate::ComputePerpendicularDistance(
input_geometry[i].location,
input_geometry[pair.first].location,
input_geometry[pair.second].location);
Expand All @@ -110,6 +112,7 @@ void DouglasPeucker::Run(std::vector<SegmentInformation> &input_geometry, const
{
// mark idx as necessary
input_geometry[farthest_element_index].necessary = true;
++counter;
if (1 < (farthest_element_index - pair.first))
{
recursion_stack.push(std::make_pair(pair.first, farthest_element_index));
Expand Down

2 comments on commit f14164a

@springmeyer
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you mean to commit the counter?

@DennisOSRM
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch. thanks

Please sign in to comment.