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.3.tar.gz (20.0 kB view details)

Uploaded Source

File details

Details for the file orthogonalizer-0.0.3.tar.gz.

File metadata

  • Download URL: orthogonalizer-0.0.3.tar.gz
  • Upload date:
  • Size: 20.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for orthogonalizer-0.0.3.tar.gz
Algorithm Hash digest
SHA256 d2b4c85667111635b6ebc8cc0668fc8d717f8d305288cd83ce95941c7ef345d4
MD5 94f451afcc5b111eb209827bb9072bfc
BLAKE2b-256 20f56ba57a57b0aa8596041f0ccf21c63ce49dbade6532295c37902cb6ae2f87

See more details on using hashes here.

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