This release is a pre-release and may not be stable for production use.
Find the maximally inscribed, axis-aligned rectangle for a given polygon. Find the intersection of multiple polygons.
Installation
pip install git+https://${GITHUB_TOKEN}@github.com/planetlabs/maxrect.git
CLI
# For a given GeoJSON file
$ max-rect [path/to/file]
# Piping
$ cat path/to/file.geojson | max-rect
# For a quick visualization
$ cat path/to/file.geojson | max-rect | geojsonio
# For comparison between the original polygon and the inscribed rectangle
$ cat path/to/file.geojson | max-rect --compare | geojsonio
# Find the intersection of two geojson files
poly-intersect path/to/file1.geojson path/to/file2.geojson | geojsonio
# Find the largest inscribed rectangle that sits within multiple shapes
poly-intersect path/to/file1.geojson path/to/file2.geojson | max-rect | geojsonio
# Find the intersection of two geojson files
poly-intersect path/to/file1.geojson path/to/file2.geojson | geojsonio
# Find the largest inscribed rectangle that sits within multiple shapes
poly-intersect path/to/file1.geojson path/to/file2.geojson | max-rect | geojsonio
Python
from maxrect import get_intersection, get_maximal_rectangle, rect2poly
# For a given convex polygon
coordinates1 = [ [x0, y0], [x1, y1], ... [xn, yn] ]
coordinates2 = [ [x0, y0], [x1, y1], ... [xn, yn] ]
# find the intersection of the polygons
_, coordinates = get_intersection([coordinates1, coordinates2])
# get the maximally inscribed rectangle
ll, ur = get_maximal_rectangle(coordinates)
# casting the rectangle to a GeoJSON-friendly closed polygon
rect2poly(ll, ur)
Metadata
Release files for maxrect 0.0.1dev
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| maxrect-0.0.1dev.tar.gz | 4.0 kB | Without provenance | Details |
Release files / maxrect-0.0.1dev.tar.gz
| Download URL | maxrect-0.0.1dev.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3b3e989ac15ab58de30751310d0c00a327210344d8a37ab1c38b0e5836f5d5f8
|
|
BLAKE2b-256 checksum How to use checksums |
906471dbc5029ee061065a7c47aa2ac3a0c6621ef49f0eda736fc524dbf01311
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for maxrect 0.0.1dev
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.