Even,

In the RFC you write that for JSON OGR currently returns unset fields when a field does not exist and when it is null. However, in a simple test I wrote this JSON

{ "type": "FeatureCollection", "features": [ { "foo" : "bar" }, { "foo" : null }, { } ] }

Opening that as a layer and reading its features I get (in Perl) foo as 'bar', '', and undef. I.e., null is mapped into an empty string and a missing field is mapped as unset (mapped to undef in Perl bindings).

Converting to GML (ogr2ogr -f "GML" test.gml test.json) I get similar result - foo is empty string for 2nd feature and missing in 3rd feature. Converting it back maps both empty string and missing into JSON null.

For PostgreSQL tables NULL is mapped to unset.

It would be logical if null field would map to null in JSON and NULL in SQL but maybe that's not possible in a backwards compatible way.

Ari


25.01.2017, 20:54, Even Rouault kirjoitti:

Hi,

I've prepared a new RFC regarding the handling of null values in OGR.

https://trac.osgeo.org/gdal/wiki/rfc67_nullfieldvalues

No implementation proposed yet at this stage. I want to check if the proposed design choices make sense.

Even

--

Spatialys - Geospatial professional services

http://www.spatialys.com



_______________________________________________
gdal-dev mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/gdal-dev

_______________________________________________
gdal-dev mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to