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 details)

Uploaded Source

File details

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

File metadata

  • Download URL: orthogonalizer-0.0.4.tar.gz
  • Upload date:
  • Size: 20.3 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.4.tar.gz
Algorithm Hash digest
SHA256 e62e15aad1b7c13aa431224996e1009101e1dc90ce9235d5f1bd6dae3f96fb8d
MD5 1ae0c8815824e25a8a9b7fb167db4986
BLAKE2b-256 75cc34bf01ca76b0d94c98e2d7a31cf985ec5544c1881265bb60f100e1cfbb24

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