MCPcopy Create free account
hub / github.com/MariaDB/server / simplify_RDP

Function simplify_RDP

sql/spatial.cc:224–231  ·  view source on GitHub ↗

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 */

Source from the content-addressed store, hash-verified

222 https://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm
223*/
224static 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 *******************************/

Callers 1

simplifyMethod · 0.85

Calls 5

recursive_RDPFunction · 0.85
push_backMethod · 0.45
frontMethod · 0.45
sizeMethod · 0.45
backMethod · 0.45

Tested by

no test coverage detected