Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Oriented Minimum Bounding Box strange behavior #33532

Closed
caprieldeluca opened this issue Dec 27, 2019 · 3 comments · Fixed by #34334
Closed

Oriented Minimum Bounding Box strange behavior #33532

caprieldeluca opened this issue Dec 27, 2019 · 3 comments · Fixed by #34334
Assignees
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Processing Relating to QGIS Processing framework or individual Processing algorithms

Comments

@caprieldeluca
Copy link

Describe the bug

By running the "Oriented Minimum Bounding Box" algorithm from the Processing Toolbox, on a polygons vector layer, in some (seemingly random) cases, the result is not as expected (it is visibly appreciated that an oriented bounding box of smaller area could be generated).

By creating a very small decimal radius buffer to the geometries of the problematic features, running the Oriented Minimum Bounding Box algorithm over the resulting geometry, gives the expected result.

How to Reproduce

  1. Create a feature with the following geometry:
    Polygon ((264 -525, 248 -521, 244 -519, 233 -508, 231 -504, 210 -445, 196 -396, 180 -332, 178 -322, 176 -310, 174 -296, 174 -261, 176 -257, 178 -255, 183 -251, 193 -245, 197 -243, 413 -176, 439 -168, 447 -166, 465 -164, 548 -164, 552 -166, 561 -175, 567 -187, 602 -304, 618 -379, 618 -400, 616 -406, 612 -414, 606 -420, 587 -430, 575 -436, 547 -446, 451 -474, 437 -478, 321 -511, 283 -521, 275 -523, 266 -525, 264 -525))
    (Tested in a layer defined in CRS = EPSG:3857, with no projection applied to the project canvas. Although I think it doesn't matter.)

  2. Run the Oriented Minimum Bounding Box algorithm to that feature.
    The output box attributes are: width = 361.00, height = 444.00, angle = 90.00.

  3. Create a Buffer of Radius = 0.001 from the original feature.

  4. Run the Oriented Minimum Bounding Box algorithm to the buffered geometry feature.
    The output box attributes are: width = 417.63, height = 298.02, angle = 162.68.

The area of the box returned by the buffered geometry feature is smaller than that returned by the original one.

QGIS and OS versions

QGIS version 3.10.1-A Coruña
Windows 10, 64bit (OSGeoo4W installation).

@caprieldeluca caprieldeluca added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Dec 27, 2019
@gioman gioman added the Processing Relating to QGIS Processing framework or individual Processing algorithms label Dec 27, 2019
@lbartoletti
Copy link
Member

Duplicate of #31371 ?

@lbartoletti lbartoletti added the Feedback Waiting on the submitter for answers label Feb 3, 2020
@caprieldeluca
Copy link
Author

Duplicate of #31371 ?

@lbartoletti , I think not.

The problem descripted here is not related to the angle calculation. The angle is well calculated for the geometry returned.

The problem is with the geometry generated.

It was not the minimum (area) oriented bounding box.

@lbartoletti lbartoletti removed the Feedback Waiting on the submitter for answers label Feb 3, 2020
@lbartoletti lbartoletti self-assigned this Feb 3, 2020
@lbartoletti
Copy link
Member

OK, confirmed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Processing Relating to QGIS Processing framework or individual Processing algorithms
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants