psimpl - generic n-dimensional polyline simplification 通用N维折线简化程序
Author - Elmar de Koning 作者 - Elmar de Koning
Support - edekoning@gmail.com
Website - http://psimpl.sf.net
Article - http://www.codeproject.com/KB/recipes/PolylineSimplification.aspx
License - MPL 1.1
psimpl
'psimpl' is a c++ polyline simplification library that is generic, easy to use, and supports the following algorithms:
Simplification
+ Nth point - A naive algorithm that keeps only each nth point
+ Distance between points - Removes successive points that are clustered together
+ Perpendicular distance - Removes points based on their distance to the line segment defined
by their left and right neighbors
+ Reumann-Witkam - Shifts a strip along the polyline and removes points that fall outside
+ Opheim - A constrained version of Reumann-Witkam
+ Lang - Similar to the Perpendicular distance routine, but instead of looking only at direct
neighbors, an entire search region is processed
+ Douglas-Peucker - A classic simplification algorithm that provides an excellent approximation
of the original line
+ A variation on the Douglas-Peucker algorithm - Slower, but yields better results at lower resolutions
Errors
+ positional error - Distance of each polyline point to its simplification
All the algorithms have been implemented in a single standalone C++ header using an STL-style
interface that operates on input and output iterators. Polylines can be of any dimension, and
defined using floating point or signed integer data types.
changelog
28-09-2010 - Initial version
23-10-2010 - Changed license from CPOL to MPL
26-10-2010 - Clarified input (type) requirements, and changed the behavior of the algorithms
under invalid input
01-12-2010 - Added the nth point, perpendicular distance and Reumann-Witkam routines; moved all
functions related to distance calculations to the math namespace
10-12-2010 - Fixed a bug in the perpendicular distance routine
27-02-2011 - Added Opheim simplification, and functions for computing positional errors due to
simplification; renamed simplify_douglas_peucker_alt to simplify_douglas_peucker_n
18-06-2011 - Added Lang simplification; fixed divide by zero bug when using integers; fixed a
bug where incorrect output iterators were returned under invalid input; fixed a bug
in douglas_peucker_n where an incorrect number of points could be returned; fixed a
bug in compute_positional_errors2 that required the output and input iterator types
to be the same; fixed a bug in compute_positional_error_statistics where invalid
statistics could be returned under questionable input; documented input iterator
requirements for each algorithm; miscellaneous refactoring of most algorithms.
Class List:
psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DPHelper | Douglas-Peucker approximation helper class |
psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DPHelper::KeyInfo | Defines the key of a polyline |
psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator > | Provides various simplification algorithms for n-dimensional simple polylines |
psimpl::util::scoped_array< T > | A smart pointer for holding a dynamically allocated array |
psimpl::math::Statistics | POD structure for storing several statistical values |
psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DPHelper::SubPoly | Defines a sub polyline |
psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DPHelper::SubPolyAlt | Defines a sub polyline including its key |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)