Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kshitijrajsharma/orthogonalizer
Pip implementation for squaring/orthogonalization of polygons
https://github.com/kshitijrajsharma/orthogonalizer
Last synced: 24 days ago
JSON representation
Pip implementation for squaring/orthogonalization of polygons
- Host: GitHub
- URL: https://github.com/kshitijrajsharma/orthogonalizer
- Owner: kshitijrajsharma
- License: gpl-3.0
- Created: 2023-08-22T08:37:14.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-08-22T12:53:27.000Z (about 1 year ago)
- Last Synced: 2024-04-25T02:42:47.615Z (7 months ago)
- Language: Python
- Homepage: https://pypi.org/project/orthogonalizer/
- Size: 27.3 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
### Polygon Orthogonalizer
Pip implementation for polygons of [orthogonalize-polygon](https://github.com/Mashin6/orthogonalize-polygon/tree/master) which is an improved implementation of JOSM Orthogonalize function (JOSM Q Function). Credits to all the respective involved authors## Installation
You can install OSM Conflator using pip:
```shell
pip install orthogonalizer
```## Usage
Here's an example of how to use Polygon orthogonalizer in your Python code:
```python
from orthogonalizer import othogonalize_polygeojson_str = '{"type": "FeatureCollection", "features": ... }'
orthogonalized_poly = othogonalize_poly(geojson_str)
print(orthogonalized_poly)
```## Options :
**maxAngleChange (int, optional)**:
angle (0,45> degrees. Sets the maximum angle deviation
from the cardinal direction for the segment to be still
considered to continue in the same direction as the
previous segment. Defaults to 15.**skewTolerance (int, optional)**:
angle <0,45> degrees.
Sets skew tolerance for segments that
are at 45˚±Tolerance angle from the overal rectangular shape
of the polygon. Usefull when preserving e.g. bay windows on a
house. Defaults to 15.## Example
Input ---> Output
![image](https://github.com/kshitijrajsharma/orthogonalizer/assets/36752999/97d2233c-c8c9-4417-80e1-16964f48383f)## Contributing
Contributions are welcome! If you find any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request. When contributing to this project, please follow the Contributing Guidelines.
## License
This project is licensed under the GNU General Public License v3.0 License. See the LICENSE file for more information.