Bug report #16812
Saving GeoJson deletes NULL attributes if QGIS is compiled against GDAL 2.2
|Affected QGIS version:||2.18.10||Regression?:||Yes|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||fixed/implemented|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||24711|
As described in https://github.com/UCDavisLibrary/ava/issues/270, Saving Geojson removes any attributes that have null values.
This is a new behavior due to a change in GDAL 2.2 https://trac.osgeo.org/gdal/wiki/rfc67_nullfieldvalues which changes how null fields are handled.
Discussing with Even R. in IRC, it seems safer to '<EvenR> "unset as null" could be the default behaviour in QGIS. It should bring back the pre GDAL 2.2 behaviour'
That way any saves made while editing a layer won't remove attributes.
As an option the Save As dialog could allow users to override this behavior, dropping null fields to create a more compact geojson file.
#1 Updated by Giovanni Manghi about 3 years ago
- Easy fix? changed from Yes to No
- Operating System deleted (
- Priority changed from Normal to High
- Subject changed from Saving GeoJson deletes null attributes to Saving GeoJson deletes NULL attributes if QGIS is compiled against GDAL 2.2
I'm reluctant to tag this as "regression" because technically is not a QGIS issue, point is that QGIS users that will start to hit this change will immediately point to QGIS as the culprit. If setting "unset as null" is trivial I suggest to implement it as soon as possible.