Bug report #11755
Real precision (Shapefile)
Status: | Closed | ||
---|---|---|---|
Priority: | Normal | ||
Assignee: | Jürgen Fischer | ||
Category: | - | ||
Affected QGIS version: | 2.6.0 | Regression?: | No |
Operating System: | Easy fix?: | No | |
Pull Request or Patch supplied: | Yes | Resolution: | fixed/implemented |
Crashes QGIS or corrupts data: | No | Copied to github as #: | 19987 |
Description
I think there is a bug with QGis 2.6 and dev (a68958f) with real attribute.
Into a column with real QGis round the last digit.
Example :
Add a column ELEVATION real "Length 6" and "Precision 2"
Add a point and into attribute "1000.25"
After saving the modification Qgis show as attribute "1000.20"
Normaly the "point" isn't into length.
Related issues
Associated revisions
ogr provider: increase width by one for decimal point if precision is given (fixes #11755)
History
#1 Updated by Jürgen Fischer over 9 years ago
- Pull Request or Patch supplied changed from No to Yes
See PR #2122
#2 Updated by Jürgen Fischer over 9 years ago
- Status changed from Open to Closed
Fixed in changeset 2fcbc8bb725f45ba1d0196a95c7f21c90894a0d6.
#3 Updated by Loïc BARTOLETTI about 9 years ago
- Assignee set to Jürgen Fischer
- Status changed from Closed to Reopened
This hack preserve last digit but allow unhautorized value. When you add a value you can do something like this: "12345.78". Normally, the max is "9999.99".
Probleme is that when you create a field with real(6,2) QGis create a DBF with real(7,2). Also, ShapeFile with real(6,2) are shown with real(5.2). You can see that with ogrinfo.
Thanks.
#4 Updated by Jürgen Fischer about 9 years ago
- Resolution set to fixed/implemented
- Status changed from Reopened to Closed
Loïc BARTOLETTI wrote:
This hack preserve last digit but allow unhautorized value. When you add a value you can do something like this: "12345.78". Normally, the max is "9999.99".
Probleme is that when you create a field with real(6,2) QGis create a DBF with real(7,2). Also, ShapeFile with real(6,2) are shown with real(5.2). You can see that with ogrinfo.
Actually that is just what the fix is supposed to do. QGIS (and for instance PostgreSQL) don't count the decimal point in - so 12345.78 corresponds to width 7, precision 2. OGR however includes the decimal point in the width - so 7,2 in QGIS has to become 8,2 in OGR.