https://github.com/jss95/curvesimplify
Python package for polyline simplification
https://github.com/jss95/curvesimplify
Last synced: 5 months ago
JSON representation
Python package for polyline simplification
- Host: GitHub
- URL: https://github.com/jss95/curvesimplify
- Owner: JSS95
- License: bsd-3-clause
- Created: 2024-08-28T03:13:21.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-08-30T00:22:57.000Z (almost 2 years ago)
- Last Synced: 2025-07-26T04:55:12.374Z (11 months ago)
- Language: Python
- Homepage: https://curvesimplify.readthedocs.io
- Size: 23.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# CurveSimplify
[](https://github.com/JSS95/curvesimplify/blob/master/LICENSE)
[](https://github.com/JSS95/curvesimplify/actions/workflows/ci.yml)
[](https://github.com/JSS95/curvesimplify/actions/workflows/cd.yml)
[](https://curvesimplify.readthedocs.io/en/latest/?badge=latest)
[](https://pypi.python.org/pypi/curvesimplify/)
[](https://pypi.python.org/pypi/curvesimplify/)

A Python package for polygonal curve simplification.
List of supported algorithms:
- Imai-Iri algorithm (`curvesimplify.imaiiri`)
- Agarwal's algorithm (`curvesimplify.agarwal`)
## Usage
```python
>>> import numpy as np
>>> from curvesimplify.agarwal import min_err
>>> x = np.linspace(0, 5, 50)
>>> f = np.exp(-x) * np.cos(2 * np.pi * x)
>>> curve = np.column_stack([x, f])
>>> simp, err = min_err(curve, 10)
>>> len(simp) # at most 10
10
```
## Installation
CurveSimplify can be installed using `pip`.
```
$ pip install curvesimplify
```
## Documentation
CurveSimplify is documented with [Sphinx](https://pypi.org/project/Sphinx/).
The manual can be found on Read the Docs:
> https://curvesimplify.readthedocs.io/
If you want to build the document yourself, get the source code and install with `[doc]` dependency.
Then, go to `doc` directory and build the document:
```
$ pip install .[doc]
$ cd doc
$ make html
```
Document will be generated in `build/html` directory. Open `index.html` to see the central page.