Skip to main content

A pip installation for orthogonalization of polygons

Project description

Polygon Orthogonalizer

Pip implementation for polygons of orthogonalize-polygon 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:

pip install orthogonalizer

Usage

Here's an example of how to use Polygon orthogonalizer in your Python code:

from orthogonalizer import othogonalize_poly

geojson_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

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

orthogonalizer-0.0.4.tar.gz (20.3 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page