4

I'm using OMBB in QGIS 3.10. Most of polygons are processing correctly, but there are some, which seems to be processing wrong:

sample

But if rotate layer a little - result will be more correct:

enter image description here

SRS - EPSG:3857.

What I'm doing wrong? Maybe problem is related with this?

UPD:

Add conflictive feature in wkt:

Polygon ((6264698.519 8041922.279, 6264698.37 8041922.279, 6264698.221 8041922.428, 6264692.1 8041922.428, 6264691.951 8041922.279, 6264690.756 8041922.279, 6264690.607 8041922.129, 6264690.159 8041922.129, 6264690.01 8041921.98, 6264689.711 8041921.98, 6264689.562 8041921.831, 6264689.413 8041921.831, 6264689.263 8041921.682, 6264688.816 8041921.682, 6264688.666 8041921.532, 6264688.218 8041921.532, 6264688.069 8041921.383, 6264687.92 8041921.383, 6264687.771 8041921.234, 6264687.621 8041921.234, 6264687.323 8041920.935, 6264687.173 8041920.935, 6264687.024 8041920.786, 6264686.725 8041920.786, 6264686.576 8041920.636, 6264686.278 8041920.636, 6264686.128 8041920.487, 6264685.83 8041920.487, 6264685.68 8041920.338, 6264685.531 8041920.338, 6264685.382 8041920.189, 6264685.233 8041920.189, 6264685.083 8041920.039, 6264684.934 8041920.039, 6264684.785 8041919.89, 6264684.635 8041919.89, 6264684.486 8041919.741, 6264684.038 8041919.741, 6264683.889 8041919.591, 6264683.59 8041919.591, 6264683.441 8041919.442, 6264683.292 8041919.442, 6264683.142 8041919.293, 6264682.993 8041919.293, 6264682.844 8041919.144, 6264682.695 8041919.144, 6264682.545 8041918.994, 6264682.247 8041918.994, 6264682.097 8041918.845, 6264681.799 8041918.845, 6264681.65 8041918.696, 6264681.202 8041918.696, 6264681.052 8041918.546, 6264680.605 8041918.546, 6264680.455 8041918.397, 6264680.306 8041918.397, 6264680.157 8041918.248, 6264679.858 8041918.248, 6264679.709 8041918.098, 6264679.41 8041918.098, 6264679.261 8041917.949, 6264678.813 8041917.949, 6264678.664 8041917.8, 6264678.216 8041917.8, 6264678.067 8041917.651, 6264677.32 8041917.651, 6264677.171 8041917.501, 6264676.275 8041917.501, 6264676.126 8041917.352, 6264675.827 8041917.352, 6264675.678 8041917.203, 6264675.23 8041917.203, 6264675.081 8041917.053, 6264674.633 8041917.053, 6264674.484 8041916.904, 6264673.737 8041916.904, 6264673.588 8041916.755, 6264673.14 8041916.755, 6264672.991 8041916.606, 6264672.692 8041916.606, 6264672.543 8041916.456, 6264672.095 8041916.456, 6264671.946 8041916.307, 6264671.796 8041916.307, 6264671.498 8041916.008, 6264671.349 8041916.008, 6264671.199 8041915.859, 6264671.05 8041915.859, 6264670.453 8041915.262, 6264670.453 8041915.113, 6264670.303 8041914.963, 6264670.303 8041912.425, 6264670.453 8041912.276, 6264670.453 8041911.38, 6264670.602 8041911.231, 6264670.602 8041910.485, 6264670.751 8041910.335, 6264670.751 8041909.738, 6264670.901 8041909.589, 6264670.901 8041909.44, 6264671.05 8041909.29, 6264671.05 8041908.992, 6264671.199 8041908.842, 6264671.199 8041908.693, 6264671.349 8041908.544, 6264671.349 8041908.096, 6264671.498 8041907.947, 6264671.498 8041907.349, 6264671.647 8041907.2, 6264671.647 8041906.454, 6264671.796 8041906.304, 6264671.796 8041905.558, 6264671.946 8041905.409, 6264671.946 8041904.961, 6264672.095 8041904.811, 6264672.095 8041904.513, 6264672.244 8041904.364, 6264672.244 8041904.065, 6264672.394 8041903.916, 6264672.394 8041903.766, 6264672.543 8041903.617, 6264672.543 8041903.319, 6264672.692 8041903.169, 6264672.692 8041902.871, 6264672.841 8041902.721, 6264672.841 8041902.124, 6264672.991 8041901.975, 6264672.991 8041901.378, 6264673.14 8041901.228, 6264673.14 8041901.079, 6264673.289 8041900.93, 6264673.289 8041900.781, 6264673.588 8041900.482, 6264673.588 8041900.333, 6264673.737 8041900.183, 6264673.737 8041900.034, 6264673.887 8041899.885, 6264673.887 8041899.586, 6264674.036 8041899.437, 6264674.036 8041899.138, 6264674.185 8041898.989, 6264674.185 8041898.541, 6264674.334 8041898.392, 6264674.334 8041897.944, 6264674.484 8041897.795, 6264674.484 8041897.347, 6264674.633 8041897.198, 6264674.633 8041896.899, 6264674.782 8041896.75, 6264674.782 8041896.6, 6264675.678 8041895.705, 6264675.827 8041895.705, 6264675.977 8041895.555, 6264676.425 8041895.555, 6264676.574 8041895.406, 6264677.022 8041895.406, 6264677.171 8041895.257, 6264677.32 8041895.257, 6264677.47 8041895.406, 6264677.917 8041895.406, 6264678.067 8041895.555, 6264678.515 8041895.555, 6264678.664 8041895.705, 6264678.962 8041895.705, 6264679.112 8041895.854, 6264679.56 8041895.854, 6264679.709 8041896.003, 6264680.157 8041896.003, 6264680.306 8041896.153, 6264680.754 8041896.153, 6264680.903 8041896.302, 6264681.351 8041896.302, 6264681.5 8041896.451, 6264681.799 8041896.451, 6264681.948 8041896.6, 6264682.098 8041896.6, 6264682.247 8041896.75, 6264682.396 8041896.75, 6264682.545 8041896.899, 6264682.695 8041896.899, 6264682.844 8041897.048, 6264683.143 8041897.048, 6264683.292 8041897.198, 6264683.74 8041897.198, 6264683.889 8041897.347, 6264684.188 8041897.347, 6264684.337 8041897.496, 6264684.486 8041897.496, 6264684.636 8041897.645, 6264684.785 8041897.645, 6264684.934 8041897.795, 6264685.083 8041897.795, 6264685.233 8041897.944, 6264685.83 8041897.944, 6264685.979 8041898.093, 6264686.576 8041898.093, 6264686.726 8041898.243, 6264687.173 8041898.243, 6264687.323 8041898.392, 6264688.069 8041898.392, 6264688.218 8041898.541, 6264688.816 8041898.541, 6264688.965 8041898.691, 6264689.413 8041898.691, 6264689.562 8041898.84, 6264690.01 8041898.84, 6264690.159 8041898.989, 6264690.607 8041898.989, 6264690.756 8041899.138, 6264691.055 8041899.138, 6264691.204 8041899.288, 6264691.503 8041899.288, 6264691.652 8041899.437, 6264691.801 8041899.437, 6264691.951 8041899.586, 6264692.1 8041899.586, 6264692.249 8041899.736, 6264692.399 8041899.736, 6264692.548 8041899.885, 6264692.697 8041899.885, 6264692.847 8041900.034, 6264693.145 8041900.034, 6264693.294 8041900.183, 6264693.593 8041900.183, 6264693.742 8041900.333, 6264694.041 8041900.333, 6264694.19 8041900.482, 6264694.489 8041900.482, 6264694.638 8041900.631, 6264695.235 8041900.631, 6264695.384 8041900.781, 6264696.28 8041900.781, 6264696.429 8041900.93, 6264697.027 8041900.93, 6264697.176 8041901.079, 6264697.624 8041901.079, 6264697.773 8041901.228, 6264698.221 8041901.228, 6264698.37 8041901.378, 6264698.52 8041901.378, 6264698.669 8041901.527, 6264698.818 8041901.527, 6264698.967 8041901.676, 6264699.266 8041901.676, 6264699.415 8041901.826, 6264699.714 8041901.826, 6264699.863 8041901.975, 6264700.311 8041901.975, 6264700.46 8041902.124, 6264700.61 8041902.124, 6264700.759 8041902.274, 6264700.908 8041902.274, 6264701.058 8041902.423, 6264701.207 8041902.423, 6264701.505 8041902.721, 6264701.655 8041902.721, 6264701.804 8041902.871, 6264701.953 8041902.871, 6264702.103 8041903.02, 6264702.252 8041903.02, 6264702.401 8041903.169, 6264702.55 8041903.169, 6264703.148 8041903.766, 6264703.148 8041903.916, 6264703.297 8041904.065, 6264703.297 8041904.214, 6264703.446 8041904.364, 6264703.446 8041904.662, 6264703.595 8041904.811, 6264703.595 8041906.304, 6264703.446 8041906.454, 6264703.446 8041906.902, 6264703.297 8041907.051, 6264703.297 8041907.2, 6264703.148 8041907.349, 6264703.148 8041907.648, 6264702.998 8041907.797, 6264702.998 8041908.245, 6264702.849 8041908.395, 6264702.849 8041909.141, 6264702.7 8041909.29, 6264702.7 8041910.186, 6264702.55 8041910.335, 6264702.55 8041911.082, 6264702.401 8041911.231, 6264702.401 8041911.828, 6264702.252 8041911.978, 6264702.252 8041912.127, 6264702.102 8041912.276, 6264702.102 8041912.425, 6264701.953 8041912.575, 6264701.953 8041912.724, 6264701.804 8041912.873, 6264701.804 8041913.023, 6264701.655 8041913.172, 6264701.655 8041913.321, 6264701.505 8041913.47, 6264701.505 8041913.769, 6264701.356 8041913.918, 6264701.356 8041914.068, 6264701.207 8041914.217, 6264701.207 8041914.515, 6264701.057 8041914.665, 6264701.057 8041914.963, 6264700.908 8041915.113, 6264700.908 8041915.411, 6264700.759 8041915.561, 6264700.759 8041915.71, 6264700.61 8041915.859, 6264700.61 8041916.158, 6264700.46 8041916.307, 6264700.46 8041916.606, 6264700.311 8041916.755, 6264700.311 8041917.501, 6264700.162 8041917.651, 6264700.162 8041918.397, 6264700.012 8041918.546, 6264700.012 8041919.293, 6264699.863 8041919.442, 6264699.863 8041919.89, 6264699.714 8041920.039, 6264699.714 8041920.636, 6264699.564 8041920.786, 6264699.564 8041920.935, 6264699.415 8041921.084, 6264699.415 8041921.234, 6264699.266 8041921.383, 6264699.266 8041921.532, 6264698.519 8041922.279))
6
  • 1
    How do you define the correctness of the result?
    – user30184
    Dec 25, 2019 at 21:28
  • 2
    I was doing some tests since the referred question was asked. Seems to be a bug with the geometry vertex coordinates when they are rounded to integers. Please, Extract by selection just the conflictive feature, make a Convex hull, and for the output layer include in the question the output of a geom_to_wkt($geometry,3) expression. Test making a Buffer of some decimal (e.g., 0.0123) radius and try the Oriented Minimum Bounding Box to the buffered layer. Source code is in line 957 of qgis.org/api/qgsgeometry_8cpp_source.html. Dec 26, 2019 at 2:47
  • @GabrielDeLuca Thanks, trick with buffer is working! Sample of conflictive feature added in post. Dec 26, 2019 at 6:36
  • You are welcome. Your geometry does not have its coordinates rounded to meter. I can't understand where is the problem but I think that this is a bug. Dec 26, 2019 at 10:05
  • OpenJUMP seems to create a good minimum bounding box out-of-the-box POLYGON (( 6264704.943593819 8041903.205278208, 6264698.644892796 8041924.624800196, 6264668.747276492 8041915.833000495, 6264675.045977515 8041894.413478508, 6264704.943593819 8041903.205278208 )).
    – user30184
    Dec 26, 2019 at 14:39

1 Answer 1

1

The issue has been fixed with PR github.com/qgis/QGIS/pull/34334 since QGIS 3.12. Thanks Andrea for the update.

The oriented minimum bounding box calculated by QGIS 3.16 for the given polygon is:
Polygon ((6264704.93729321844875813 8041903.20301713142544031, 6264698.6385921984910965 8041924.62253911606967449, 6264668.74097589403390884 8041915.83073944505304098, 6264675.03967691399157047 8041894.4112174604088068, 6264704.93729321844875813 8041903.20301713142544031))

I have reported an issue on this in the following link: https://github.com/qgis/QGIS/issues/33532. At the moment, a workaround is to change the coordinates of the vertices of the geometry.

This can be done by reprojecting the layer to another coordinate system, or by applying a minimal decimal buffer over the geometry of the problematic features.

1
  • 1
    The issue has been fixed with PR github.com/qgis/QGIS/pull/34334 since QGIS 3.12. The oriented minimum bounding box calculated by QGIS 3.16 for the given polygon is: Polygon ((6264704.93729321844875813 8041903.20301713142544031, 6264698.6385921984910965 8041924.62253911606967449, 6264668.74097589403390884 8041915.83073944505304098, 6264675.03967691399157047 8041894.4112174604088068, 6264704.93729321844875813 8041903.20301713142544031)) Mar 17, 2022 at 12:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.