{"id":17204405,"url":"https://github.com/urschrei/rdp","last_synced_at":"2025-04-12T07:42:04.589Z","repository":{"id":40605310,"uuid":"64860910","full_name":"urschrei/rdp","owner":"urschrei","description":"A library providing FFI access to fast Ramer–Douglas–Peucker and Visvalingam-Whyatt line simplification algorithms","archived":false,"fork":false,"pushed_at":"2024-05-04T21:10:38.000Z","size":6095,"stargazers_count":24,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-26T02:51:12.356Z","etag":null,"topics":["computational-geometry","ffi","geo","geospatial","rdp","rust-library","visvalingam"],"latest_commit_sha":null,"homepage":"https://docs.rs/rdp","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/urschrei.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-08-03T16:20:05.000Z","updated_at":"2025-02-10T18:30:48.000Z","dependencies_parsed_at":"2022-09-07T14:42:13.104Z","dependency_job_id":"5fcb275f-9720-45de-8c43-a63d9571f065","html_url":"https://github.com/urschrei/rdp","commit_stats":{"total_commits":290,"total_committers":5,"mean_commits":58.0,"dds":0.5724137931034483,"last_synced_commit":"b363384492e742cc062cbd329c899fe5424f7b20"},"previous_names":[],"tags_count":106,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urschrei%2Frdp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urschrei%2Frdp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urschrei%2Frdp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urschrei%2Frdp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/urschrei","download_url":"https://codeload.github.com/urschrei/rdp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248536981,"owners_count":21120683,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["computational-geometry","ffi","geo","geospatial","rdp","rust-library","visvalingam"],"created_at":"2024-10-15T02:21:47.394Z","updated_at":"2025-04-12T07:42:04.569Z","avatar_url":"https://github.com/urschrei.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Test and Build](https://github.com/urschrei/rdp/actions/workflows/test.yml/badge.svg)](https://github.com/urschrei/rdp/actions/workflows/test.yml) [![Coverage Status](https://coveralls.io/repos/github/urschrei/rdp/badge.svg?branch=master)](https://coveralls.io/github/urschrei/rdp?branch=master) [![](https://img.shields.io/crates/v/rdp.svg)](https://crates.io/crates/rdp)\n\n# RDP\nA Rust implementation of the [Ramer–Douglas-Peucker](https://en.wikipedia.org/wiki/Ramer–Douglas–Peucker_algorithm) and [Visvalingam-Whyatt](https://bost.ocks.org/mike/simplify/) line simplification algorithms.\n\n**The algorithms underlying this crate have now migrated to [rust-geo](https://github.com/georust/rust-geo) as the [`Simplify`](https://docs.rs/geo/*/geo/algorithm/simplify/index.html) and [`SimplifyVW`](https://docs.rs/geo/*/geo/algorithm/simplifyvw/index.html) traits.**\n\n# FFI\nThe shared library exposes a(n) FFI: https://docs.rs/rdp/latest/rdp/#functions.  \nSome examples are available in [this Jupyter notebook](examples.ipynb).  \n[**Simplification**](https://pypi.python.org/pypi/simplification/), a Python package which uses this shared library, is available from PyPi.\n\n### Example Implementation\nA Python 2.7 / 3.5 / 3.6 implementation can be found at [`ffi.py`](ffi.py\n)  \nRun `cargo build --release`, then `python ffi.py` to test. It's also importable, exposing `simplify_linestring()` – call it with a coordinate list and a precision parameter. Allocated memory is dropped on exit.  \n\n# Performance \u0026 Complexity\nOn an 841-point LineString, RDP runs around 3.5x faster than VW. However, RDP's worst-case time complexity is O(*n*\u003csup\u003e2\u003c/sup\u003e) – This implementation doesn't use the Convex Hull Speedup, see [Hershberger \u0026 Snoeyink](http://dl.acm.org/citation.cfm?id=902273), 1992 – whereas the VW implementation uses a min-heap, and thus has worst-case time-complexity of O(*n* log(*n*)), which may make it a better choice for larger LineStrings under certain conditions; RDP has an *average* time complexity of O(*n* log(*n*)), but LineStrings such as the one seen [here](http://stackoverflow.com/a/31566048/416626) will slow it down significantly.\nYou can verify these times for yourself by running `cargo bench`.\n\n# License\n[MIT](license.txt)\n\n# References\n**Douglas, D.H.**, **Peucker, T.K.**, 1973. *Algorithms for the reduction of the number of points required to represent a digitized line or its caricature*. Cartographica: The International Journal for Geographic Information and Geovisualization 10, 112–122. [DOI](http://dx.doi.org/10.3138/FM57-6770-U75U-7727)\n\n**Ramer, U.**, 1972. *An iterative procedure for the polygonal approximation of plane curves*. Computer Graphics and Image Processing 1, 244–256. [DOI](http://dx.doi.org/10.1016/S0146-664X(72)80017-0)\n\n**Visvalingam, M.**, **Whyatt, J.D.**, 1993. *Line generalisation by repeated elimination of points*. The Cartographic Journal 30, 46–51. [DOI](http://dx.doi.org/10.1179/000870493786962263)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furschrei%2Frdp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Furschrei%2Frdp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furschrei%2Frdp/lists"}