Bug report #13893
Short arcs/curves have wrong center and radius and results big circles to map
|Affected QGIS version:||2.12.0||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||Yes||Resolution:|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||21915|
I have noticed that short circular arc/curve geometries in QGIS gets wrong center and radius and so they are also drawn incorrectly.
As a result there can be seen big circles in many places in map data.
I made one example for you to see incorrect result.
I attached three CSV (WKT) files.
You can add them in QGIS separately to three layers with following parameters:
First row has attribute names
Geometry format: Well known text (WKT)
Geometry attribute: wkt_geom
Geometry type: lookup
Coordinate system: EPSG:3879 (ETRS89 / GK25FIN)
In levels window, put off level "arc_wrong_circle"
Put on levels "arc_endpoints_line" and "arc_points_linestring"
Zoom to full.
Put different colors for levels to identify them and zoom more near line centers.
See that "arc_endpoints_line" is on right side of "arc_points_linestring" which means that correct circle center should be on right side too.
Geometry "arc_wrong_circle" shows that QGIS calculates circle center on wrong side and it's radius is also wrong
I find one place in your code, that I would like to make better (I don't know if there are more functions of same kind).
Definition at line 269 of file qgsgeometryutils.cpp
My replacement code is in attachment file QgsGeometryUtils_circleCenterRadius.txt
I have tested my code with Python in Safe Software FME environment and also in PostGIS environment with 17000 arcs inside different kind of geometries and it has looked good.
Our staff in City of Helsinki is using QGIS more and more, so it would be nice if someone has time to make this correction to code.
City of Helsinki, Finland
#1 Updated by Giovanni Manghi almost 5 years ago
- Category set to Geometry
- Pull Request or Patch supplied changed from No to Yes
- Priority changed from High to Normal
- Assignee set to Marco Hugentobler
- Status changed from Open to Feedback
Hi Timo, thanks for the patch. May I ask you to submit it as pull request on QGIS github repository?
#2 Updated by Timo Iipponen almost 5 years ago
Can I please skip that and some more experienced can do. Help pages looked quite complicated and I am leaving to travel for one week. After than I can look more if needed.
The meaning of this bug fix is that without it, the QGIS is complete useless for data with curves. I hope somebody finds interest to do this while I am away. Either I try to do after my travel.
Anyway afterwards I can do big testing with real data.