fix twisted conversion, fixes #1000
This commit is contained in:
parent
52e5483dfb
commit
181e814139
@ -60,6 +60,8 @@ static double DouglasPeuckerThresholds[19] = {262144., // z0
|
|||||||
|
|
||||||
void DouglasPeucker::Run(std::vector<SegmentInformation> &input_geometry, const unsigned zoom_level)
|
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(zoom_level < 19, "unsupported zoom level");
|
||||||
BOOST_ASSERT_MSG(1 < input_geometry.size(), "geometry invalid");
|
BOOST_ASSERT_MSG(1 < input_geometry.size(), "geometry invalid");
|
||||||
@ -95,7 +97,7 @@ void DouglasPeucker::Run(std::vector<SegmentInformation> &input_geometry, const
|
|||||||
// find index idx of element with max_distance
|
// find index idx of element with max_distance
|
||||||
for (unsigned i = pair.first + 1; i < pair.second; ++i)
|
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[i].location,
|
||||||
input_geometry[pair.first].location,
|
input_geometry[pair.first].location,
|
||||||
input_geometry[pair.second].location);
|
input_geometry[pair.second].location);
|
||||||
@ -110,6 +112,7 @@ void DouglasPeucker::Run(std::vector<SegmentInformation> &input_geometry, const
|
|||||||
{
|
{
|
||||||
// mark idx as necessary
|
// mark idx as necessary
|
||||||
input_geometry[farthest_element_index].necessary = true;
|
input_geometry[farthest_element_index].necessary = true;
|
||||||
|
++counter;
|
||||||
if (1 < (farthest_element_index - pair.first))
|
if (1 < (farthest_element_index - pair.first))
|
||||||
{
|
{
|
||||||
recursion_stack.push(std::make_pair(pair.first, farthest_element_index));
|
recursion_stack.push(std::make_pair(pair.first, farthest_element_index));
|
||||||
|
Loading…
Reference in New Issue
Block a user