<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>Even,</p>
<p>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</p>
<p>{
"type": "FeatureCollection",
"features": [
{
"foo" : "bar"
},
{
"foo" : null
},
{
}
]
}
</p>
<p>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).</p>
<p>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.</p>
<p>For PostgreSQL tables NULL is mapped to unset.</p>
<p>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.</p>
<p>Ari
</p>
<br>
<div class="moz-cite-prefix">25.01.2017, 20:54, Even Rouault
kirjoitti:<br>
</div>
<blockquote cite="mid:5072295.SuT4PmY2Is@even-i700" type="cite">
<meta name="qrichtext" content="1">
<style type="text/css">
p, li { white-space: pre-wrap; }
</style>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Hi,</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">I've prepared a new RFC regarding the handling of null values in OGR.</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><a class="moz-txt-link-freetext" href="https://trac.osgeo.org/gdal/wiki/rfc67_nullfieldvalues">https://trac.osgeo.org/gdal/wiki/rfc67_nullfieldvalues</a></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">No implementation proposed yet at this stage. I want to check if the proposed design choices make sense.</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Even</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">-- </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Spatialys - Geospatial professional services</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><a class="moz-txt-link-freetext" href="http://www.spatialys.com">http://www.spatialys.com</a></p>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
gdal-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/gdal-dev">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a></pre>
</blockquote>
<br>
</body>
</html>