dbf null number are written as 0
Closed this issue · 2 comments
mukoki commented
In Dbf, empty string in a number field is read as null, but then, null is written as 0 so that original dbf is not preserved after a read+write operation
jratike80 commented
Probably this change is not harmful but I think that the old behavior was alike what ESRI does. See https://support.esri.com/en/technical-article/000005811.
The attributes in a shapefile are maintained in a dBase file. Until dBase 7, the dBase format did not support the concept of a NULL value. In ArcView 3.x and in ArcMap 8.x, NULL integers in a shapefile are stored as 0, and NULL text strings are stored as a space.
mukoki commented
Hi Jukka,Thank you for your comment and reference, very useful.I will reconsider this change after your remark and some more tests (seems that there are some options in ogr2ogr - https://gdal.org/programs/ogr2ogr.html and I haven't test qgis yet).
At the moment, my position would be :
- if some major gis (notably arcgis) consider empty number values as erroneous and refuse to parse it, so we should align to esri spec.
- is some well-known drivers make a difference between empty fields (for null) and 0.0 field and shapefile are still readable by common gis software, so it's nice to preserve this distinction so that no information is lost by OpenJUMP