[GIS] QGIS rounds up the coordinates to six decimals when saving layer changes

qgisshapefile

I have the problem that when I create a new point (in a point layer) or a new line (in a line layer of course) and I save the changes to the layer (so NOT the project save) then QGIS rounds up the coordinates of the new element to six decimals. I can see that in the "identify results" window by clicking on "(Derived"). So as a result, I don't get the required position of the new element. The layers are DB tables that I received and I just open them in QGIS. I don't know the source of the layers. The CRS of the project is the same as the CRS of the layer. The thing is, if I create a new shapefile-layer myself (point for example), the new element remains in the wanted location even after saving layer changes. So it has something to do with the layer I received. But I don't know what that is. I am trying for 3 days to find a solution and can't seem to solve the problem. Does anyone have a hint for me?

Bevore saving the layer changes:
bevore save

After saving the layer changes:
after save

Best Answer

This is a bug in QGIS. I've created a bug report here.

It relates to the MS SQL data provider using WKT by default to save and update records. The QgsGeometry::exportToWkt() method rounds coordinates to 6 decimal places. In more recent versions, this has been increased to 8, but it is still rounding.