Skip to content

function for oriented, not-axis-aligned envelope (minimum rotated rectangle) #2900

@quassy

Description

@quassy

It would be great if Turf not only supported calculating the axis-aligned envelope (bounding box geometry) but also a not-axis-aligned envelope, for example like shapely and PostGIS do.

Image

This can naively be implemented by rotating the convex hull of a geometry, getting the axis-aligned envelope of the rotated, stopping when the envelope has a minimum area, and then rotating the axis-aligned envelope by the angle when that area was reached. But I'm sure there is a more efficient algorithm.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions