Oriented Minimum Bounding Box strange behavior #33532
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
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
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.)
Run the Oriented Minimum Bounding Box algorithm to that feature.
The output box attributes are: width = 361.00, height = 444.00, angle = 90.00.
Create a Buffer of Radius = 0.001 from the original feature.
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).
The text was updated successfully, but these errors were encountered: