Bug report #7638
MSSQL data provider rounds geometry on save
Status: | Closed | ||
---|---|---|---|
Priority: | High | ||
Assignee: | Tamas Szekeres | ||
Category: | Data Provider/MSSQL | ||
Affected QGIS version: | master | Regression?: | No |
Operating System: | Easy fix?: | No | |
Pull Request or Patch supplied: | No | Resolution: | |
Crashes QGIS or corrupts data: | No | Copied to github as #: | 16559 |
Description
I've been using a data source coming from an MS SQL server table. I noticed on copying across points to the layer and saving it, the points end up in a slightly different position to the source.
More investigation points to the MS SQL data provider using WKT to insert/update geometry. Because it uses QgsGeometry::exportToWkt(), the WKT is rounded to 6 decimal places. For my source data, this resulted in inaccuracies of approximately 50mm or so.
There is a mUseWkb flag used in QgsMssqlProvider to determine whether WKT or WKB is used, but I have no idea how to set that option from within QGIS. Shouldn't the provider avoid rounding on updating, anyway?
Associated revisions
History
#1 Updated by Matthew Schubert over 11 years ago
Further investigation indicates that QgsGeometry::exportToWkt() now rounds to 8 decimal places instead of 6, as of 63e8188bb9d62c9a810ee41f63f36c76db3cc3a1. Still, I think the code should be change to introduce NO rounding errors on save.
#2 Updated by Nathan Woodrow over 11 years ago
- Priority changed from Normal to High
- Assignee set to Tamas Szekeres
Tamas would be able to take a look at this?
#3 Updated by Paolo Cavallini over 11 years ago
- Category set to Data Provider/MSSQL
#4 Updated by Jürgen Fischer over 11 years ago
- Status changed from Open to Closed
Fixed in changeset b1efd47961260f58e3536f1916dab196f3ed8d15.