Bug report #16722
Wrong result for curveToLine with max angle 70 on a semicircle
Status: | Closed | ||
---|---|---|---|
Priority: | Normal | ||
Assignee: | Sandro Santilli | ||
Category: | Geometry | ||
Affected QGIS version: | master | Regression?: | No |
Operating System: | Easy fix?: | No | |
Pull Request or Patch supplied: | Yes | Resolution: | |
Crashes QGIS or corrupts data: | No | Copied to github as #: | 24621 |
Description
This code snippet shows how a MaxAngle:70-degrees linearization of a curve gives a wrong result:
wkt = QStringLiteral( "CIRCULARSTRING(0 0,100 100,200 0)" ); circularString.reset( dynamic_cast<QgsCircularString *>( QgsGeometryFactory::geomFromWkt( wkt ) ) ); QVERIFY( circularString.get() ); lineString.reset( circularString->curveToLine( 70 * M_PI / 180.0 ) ); QVERIFY( lineString.get() ); //lineString->asWkt(); std::cout << "XXX --- " << lineString->asWkt().toStdString() << std::endl;
You can see the resulting line here:
Expected resulting line (obtained via PostGIS ongoing work https://gitlab.com/postgis/postgis/merge_requests/3) is this:
Related issues
Associated revisions
History
#1 Updated by Sandro Santilli over 7 years ago
- Related to Bug report #16717: curveToLine introduces duplicated points added
#2 Updated by Sandro Santilli over 7 years ago
- Assignee set to Sandro Santilli
- Status changed from Open to In Progress
#3 Updated by Sandro Santilli over 7 years ago
Test for this added to https://github.com/qgis/QGIS/pull/4746
#4 Updated by Sandro Santilli over 7 years ago
- Pull Request or Patch supplied changed from No to Yes
The PR now also contains a fix for this bug
#5 Updated by Sandro Santilli over 7 years ago
- % Done changed from 0 to 100
- Status changed from In Progress to Closed
Applied in changeset qgis|48c953991e15b56e9e9300ec8007d44ce1c64966.