mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
Add failing test to ensure that QgsAbstractGeometry.centroid
result matches that of GEOS It doesn't, and reveals the the QGIS native centroid calculation is quite broken
This commit is contained in:
parent
631c7cd1dd
commit
e55fbebf68
@ -4108,6 +4108,11 @@ class TestQgsGeometry(unittest.TestCase):
|
||||
self.assertTrue(compareWkt(result, exp, 0.00001),
|
||||
"centroid: mismatch Expected:\n{}\nGot:\n{}\n".format(exp, result))
|
||||
|
||||
# QGIS native algorithms are bad!
|
||||
if False:
|
||||
result = QgsGeometry(input.geometry().centroid()).exportToWkt()
|
||||
self.assertTrue(compareWkt(result, exp, 0.00001),
|
||||
"centroid: mismatch using QgsAbstractGeometry methods Input {} \n Expected:\n{}\nGot:\n{}\n".format(t[0], exp, result))
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
Loading…
x
Reference in New Issue
Block a user