Implements the Ramer–Douglas–Peucker. Given the points that compose a line, finds a similar curve with fewer points. The simplified curve consists of a subset of the points that defined the original curve. https://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm */
| 222 | https://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm |
| 223 | */ |
| 224 | static void simplify_RDP(std::vector<st_point_2d>& points, |
| 225 | const double max_distance) { |
| 226 | std::vector<st_point_2d> result; |
| 227 | result.push_back(points.front()); |
| 228 | recursive_RDP(points, max_distance, result, 0,(uint32) points.size() - 1); |
| 229 | result.push_back(points.back()); |
| 230 | points = std::move(result); |
| 231 | } |
| 232 | |
| 233 | |
| 234 | /***************************** Gis_class_info *******************************/ |