# crdp
[![PyPI version](https://badge.fury.io/py/crdp.svg)](https://badge.fury.io/py/crdp)
Cython implementation of Ramer-Douglas-Peucker algorithm.
## Usage
```
pip install crdp
```
```python
In [1]: from crdp import rdp
In [2]: rdp([[1,1],[2,3],[3,3],[4,4]], 0.8)
Out[2]: [[1, 1], [4, 4]]
In [3]: rdp([[1,1],[2,3],[3,3],[4,4]], 0.7)
Out[3]: [[1, 1], [2, 3], [4, 4]]
```
## Performance
10k random points can be processed in a few milliseconds.
Over 100x faster than python native implementation.
```
$ python3 benchmark.py
rdp 100 points, epsilon=0, duration 28.990745544433594 ms
crdp 100 points, epsilon=0, duration 0.0 ms
rdp 100 points, epsilon=0.01, duration 35.98904609680176 ms
crdp 100 points, epsilon=0.01, duration 0.0 ms
rdp 100 points, epsilon=0.1, duration 35.98833084106445 ms
crdp 100 points, epsilon=0.1, duration 0.0 ms
rdp 100 points, epsilon=0.5, duration 21.99268341064453 ms
crdp 100 points, epsilon=0.5, duration 0.0 ms
rdp 100 points, epsilon=1, duration 3.9980411529541016 ms
crdp 100 points, epsilon=1, duration 0.0 ms
rdp 1000 points, epsilon=0, duration 489.84360694885254 ms
crdp 1000 points, epsilon=0, duration 1.0001659393310547 ms
rdp 1000 points, epsilon=0.01, duration 513.8356685638428 ms
crdp 1000 points, epsilon=0.01, duration 0.0 ms
rdp 1000 points, epsilon=0.1, duration 470.84927558898926 ms
crdp 1000 points, epsilon=0.1, duration 0.9999275207519531 ms
rdp 1000 points, epsilon=0.5, duration 497.84135818481445 ms
crdp 1000 points, epsilon=0.5, duration 0.0 ms
rdp 1000 points, epsilon=1, duration 42.986392974853516 ms
crdp 1000 points, epsilon=1, duration 0.9999275207519531 ms
rdp 10000 points, epsilon=0, duration 7042.751789093018 ms
crdp 10000 points, epsilon=0, duration 5.997896194458008 ms
rdp 10000 points, epsilon=0.01, duration 6574.901103973389 ms
crdp 10000 points, epsilon=0.01, duration 4.998445510864258 ms
rdp 10000 points, epsilon=0.1, duration 6856.811046600342 ms
crdp 10000 points, epsilon=0.1, duration 4.998683929443359 ms
rdp 10000 points, epsilon=0.5, duration 6256.002902984619 ms
crdp 10000 points, epsilon=0.5, duration 3.998994827270508 ms
rdp 10000 points, epsilon=1, duration 407.8691005706787 ms
crdp 10000 points, epsilon=1, duration 1.9996166229248047 ms
```
Raw data
{
"_id": null,
"home_page": "https://github.com/biran0079/crdp",
"name": "crdp",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "rdp ramer douglas peucker line simplification cython",
"author": "Ran Bi",
"author_email": "biran0079@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/af/f4/4ed35a87ece5321a59b0ee4f9a41686b8e31929f34efe6ffea669667c8b2/crdp-0.0.2.tar.gz",
"platform": "",
"description": "# crdp\n[![PyPI version](https://badge.fury.io/py/crdp.svg)](https://badge.fury.io/py/crdp)\n\nCython implementation of Ramer-Douglas-Peucker algorithm.\n\n## Usage\n```\npip install crdp\n```\n\n```python\nIn [1]: from crdp import rdp\n\nIn [2]: rdp([[1,1],[2,3],[3,3],[4,4]], 0.8)\nOut[2]: [[1, 1], [4, 4]]\n\nIn [3]: rdp([[1,1],[2,3],[3,3],[4,4]], 0.7)\nOut[3]: [[1, 1], [2, 3], [4, 4]]\n```\n\n## Performance\n10k random points can be processed in a few milliseconds. \nOver 100x faster than python native implementation.\n\n```\n$ python3 benchmark.py\nrdp 100 points, epsilon=0, duration 28.990745544433594 ms\ncrdp 100 points, epsilon=0, duration 0.0 ms\nrdp 100 points, epsilon=0.01, duration 35.98904609680176 ms\ncrdp 100 points, epsilon=0.01, duration 0.0 ms\nrdp 100 points, epsilon=0.1, duration 35.98833084106445 ms\ncrdp 100 points, epsilon=0.1, duration 0.0 ms\nrdp 100 points, epsilon=0.5, duration 21.99268341064453 ms\ncrdp 100 points, epsilon=0.5, duration 0.0 ms\nrdp 100 points, epsilon=1, duration 3.9980411529541016 ms\ncrdp 100 points, epsilon=1, duration 0.0 ms\nrdp 1000 points, epsilon=0, duration 489.84360694885254 ms\ncrdp 1000 points, epsilon=0, duration 1.0001659393310547 ms\nrdp 1000 points, epsilon=0.01, duration 513.8356685638428 ms\ncrdp 1000 points, epsilon=0.01, duration 0.0 ms\nrdp 1000 points, epsilon=0.1, duration 470.84927558898926 ms\ncrdp 1000 points, epsilon=0.1, duration 0.9999275207519531 ms\nrdp 1000 points, epsilon=0.5, duration 497.84135818481445 ms\ncrdp 1000 points, epsilon=0.5, duration 0.0 ms\nrdp 1000 points, epsilon=1, duration 42.986392974853516 ms\ncrdp 1000 points, epsilon=1, duration 0.9999275207519531 ms\nrdp 10000 points, epsilon=0, duration 7042.751789093018 ms\ncrdp 10000 points, epsilon=0, duration 5.997896194458008 ms\nrdp 10000 points, epsilon=0.01, duration 6574.901103973389 ms\ncrdp 10000 points, epsilon=0.01, duration 4.998445510864258 ms\nrdp 10000 points, epsilon=0.1, duration 6856.811046600342 ms\ncrdp 10000 points, epsilon=0.1, duration 4.998683929443359 ms\nrdp 10000 points, epsilon=0.5, duration 6256.002902984619 ms\ncrdp 10000 points, epsilon=0.5, duration 3.998994827270508 ms\nrdp 10000 points, epsilon=1, duration 407.8691005706787 ms\ncrdp 10000 points, epsilon=1, duration 1.9996166229248047 ms\n```",
"bugtrack_url": null,
"license": "MIT",
"summary": "A fast Ramer-Douglas-Peucker algorithm implementation.",
"version": "0.0.2",
"split_keywords": [
"rdp",
"ramer",
"douglas",
"peucker",
"line",
"simplification",
"cython"
],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "57527a934741ca17b9479653a0bfd7ce",
"sha256": "01cb5b60276e3de8fabfe4110d40fdeb478567d005a54c7afe584c0a7ebb58a5"
},
"downloads": -1,
"filename": "crdp-0.0.2.tar.gz",
"has_sig": false,
"md5_digest": "57527a934741ca17b9479653a0bfd7ce",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 32145,
"upload_time": "2019-07-15T07:34:14",
"upload_time_iso_8601": "2019-07-15T07:34:14.941601Z",
"url": "https://files.pythonhosted.org/packages/af/f4/4ed35a87ece5321a59b0ee4f9a41686b8e31929f34efe6ffea669667c8b2/crdp-0.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2019-07-15 07:34:14",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "biran0079",
"github_project": "crdp",
"travis_ci": true,
"coveralls": false,
"github_actions": false,
"lcname": "crdp"
}