I am using QGIS version 2.18.14 with GRASS 7.2.2 to clean up some geometry issues within shp files I have.
I have an initial shapefile “test.shp” which has a field named “area”. The “area” type is REAL with LENGTH = 15 and PRECISION = 7.
I do the following:
- I load in QGIS (with GRASS7) the file “test.shp” using v.in.ogr (snapping 1.0 and minimal area 10.0) and specify the file name as “test” in the dialog. It all goes well. The file is saved in my GRASS folder with the usual three sub-layers (0 - holes, 1- “fixed” (as I call it), 2 - overlaps).
- Then I navigate to my GRASS folder and load the “test_1” (the “fixed” sublayer).
- Now, when I open the attribute table I can see the field “area” and the values shown there are decimal numbers (e.g. 12.345 ... as they should be).
However, if I open the Properties of the “test_1” the field “area” is defined as “double”, but with LENGTH = 20 and PRECISION = 0. When I save the the “test_1” as “test_new.shp”, and then load the “test_new.shp” in the QGIS the field “area” of the “test_new.shp” has lost all the decimal places (e.g. instead of 12.234 is stands 12). If I create a new field “new_area” with LENGTH 15 and PRECISION 7 using the field calculator (“new_area”=1.0 * “area”), I can confirm the loss of precision (i.e. I get 12.000000).
Does anybody have an idea how to go around this?