openjump-gis / openjump

OpenJUMP, the Open Source GIS with more than one trick in its kangaroo pocket, takes the leap from svn to git. join the effort!
http://openjump.org
GNU General Public License v2.0
28 stars 14 forks source link

dbf null number are written as 0 #64

Closed mukoki closed 1 year ago

mukoki commented 1 year ago

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 1 year ago

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 1 year ago

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.