Skip to content

Commit

Permalink
return gracefully instead of failing of geometry is only a single node
Browse files Browse the repository at this point in the history
  • Loading branch information
DennisOSRM committed May 12, 2014
1 parent 07231d3 commit a6bfec2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Algorithms/DouglasPeucker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,14 @@ DouglasPeucker::DouglasPeucker()

void DouglasPeucker::Run(std::vector<SegmentInformation> &input_geometry, const unsigned zoom_level)
{
BOOST_ASSERT_MSG(!input_geometry.empty(), "geometry invalid");
if (input_geometry.size() <= 2)
{
return;
}

{
BOOST_ASSERT_MSG(zoom_level < 19, "unsupported zoom level");
BOOST_ASSERT_MSG(1 < input_geometry.size(), "geometry invalid");
unsigned left_border = 0;
unsigned right_border = 1;
// Sweep over array and identify those ranges that need to be checked
Expand Down

0 comments on commit a6bfec2

Please sign in to comment.