Subject: [ggl] Simplifying polygons with co-linear points
From: Barend Gehrels (barend)
Date: 2011-10-14 02:54:04
> His is my attempt at a patch that implements the modification suggested by Luke.
> I don't know exactly why, but I could not get the original ref_candidates to work with std::rotate. I don't know if it is because it was created from the const reference to the input Range, but it simply wouldn't work. It compiled fine and ran fine, it just didn't actually rotate. Instead, I created a copy of the range, rotated the range, then created a new std::vector<dp_point_type> from the rotated Range. Then I run DP as normal. I realize this might slow things down and use more memory for very large geometries because a std::vector<dp_point_type> is created twice. If you can tell me how to get the original std::vector created in the line
> std::vector<dp_point_type> ref_candidates(boost::begin(range), boost::end(range));
> to rotate properly then I can avoid this and submit an updated patch.
Hope to look at it tonight or tomorrow.
Geometry list run by mateusz at loskot.net