Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix incorrect area calculation for polygon (fix #14675)
- Loading branch information
1 parent
a6cb81b
commit bf4cf51
Showing
2 changed files
with
14 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
|
@@ -43,6 +43,7 @@ class TestQgsDistanceArea: public QObject | ||
void measureUnits(); | void measureUnits(); | ||
void measureAreaAndUnits(); | void measureAreaAndUnits(); | ||
void emptyPolygon(); | void emptyPolygon(); | ||
void regression14675(); | |||
|
|
||
}; | }; | ||
|
|
||
|
@@ -356,6 +357,17 @@ void TestQgsDistanceArea::emptyPolygon() | ||
da.measurePolygon( QList< QgsPoint >() ); | da.measurePolygon( QList< QgsPoint >() ); | ||
} | } | ||
|
|
||
void TestQgsDistanceArea::regression14675() | |||
{ | |||
//test regression #14675 | |||
QgsDistanceArea calc; | |||
calc.setEllipsoidalMode( true ); | |||
calc.setEllipsoid( "GRS80" ); | |||
calc.setSourceCrs( 145L ); | |||
QgsGeometry geom( QgsGeometryFactory::geomFromWkt( "Polygon ((917593.5791854317067191 6833700.00807378999888897, 917596.43389983859378844 6833700.67099479306489229, 917599.53056440979707986 6833700.78673478215932846, 917593.5791854317067191 6833700.00807378999888897))" ) ); | |||
QVERIFY( qgsDoubleNear( calc.measureArea( &geom ), 0.83301, 0.0001 ) ); | |||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
nyalldawson
Author
Collaborator
|
|||
} | |||
|
|||
QTEST_MAIN( TestQgsDistanceArea ) | QTEST_MAIN( TestQgsDistanceArea ) | ||
#include "testqgsdistancearea.moc" | #include "testqgsdistancearea.moc" | ||
|
|
||
|
@nyalldawson on osx we get some difference:
https://travis-ci.org/qgis/QGIS/jobs/138311086#L1166
I think the regression which is tested is several orders of magnitude worse. What do you think, is there something to fix or should the tolerance be adjusted?