<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML-esimuotoiltu Char";
        margin:0cm;
        font-size:10.0pt;
        font-family:"Courier New";}
span.HTML-esimuotoiltuChar
        {mso-style-name:"HTML-esimuotoiltu Char";
        mso-style-priority:99;
        mso-style-link:HTML-esimuotoiltu;
        font-family:Consolas;}
span.Shkpostityyli21
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;
        mso-ligatures:none;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 2.0cm 70.85pt 2.0cm;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="FI" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">So maybe the following SQL with the OGR SQL dialect is then the easiest method for getting the desired result with GDAL:<br>
<br>
ogrinfo jsonjson.json -sql "select * EXCEPT (key), cast(key as character) from file" jsonjson.json<br>
…<br>
key (String) = { "start": "2000-01-01", "end": "2023-11-30" }<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">However, that trick is not exposed to QGIS but maybe there is some other workaround for QGIS.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">-Jukka-<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><br>
<br>
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b>Lähettäjä:</b> Even Rouault <even.rouault@spatialys.com> <br>
<b>Lähetetty:</b> torstai 22. helmikuuta 2024 21.32<br>
<b>Vastaanottaja:</b> Rahkonen Jukka <jukka.rahkonen@maanmittauslaitos.fi>; 'gdal-dev@lists.osgeo.org' (gdal-dev@lists.osgeo.org) <gdal-dev@lists.osgeo.org><br>
<b>Aihe:</b> Re: [gdal-dev] GeoJSON: json as string<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Jukka, <br>
<br>
<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US">I am looking at a question in gis.stackexchange
<a href="https://gis.stackexchange.com/questions/476489/geojson-item-considered-a-json-instead-of-a-string">
https://gis.stackexchange.com/questions/476489/geojson-item-considered-a-json-instead-of-a-string</a>. I thought that open option ARRAY_AS_STRING would have some effect on opening the test data, but it does not. Ogrinfo returns String(JSON) with both YES and
 NO<br>
key (String(JSON)) = { "start": "2000-01-01", "end": "2023-11-30" }</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US">Have I understood something wrong?</span><o:p></o:p></p>
</div>
</blockquote>
<p>{ "start": "2000-01-01", "end": "2023-11-30" } is not a JSON array, but a JSON object/dict, hence the ARRAY_AS_STRING has no effect on that property.<o:p></o:p></p>
<p>It would only affect something like [ "2000-01-01", "2023-11-30" ]<o:p></o:p></p>
<p>Even<o:p></o:p></p>
<p>-- <o:p></o:p></p>
<pre><a href="http://www.spatialys.com/">http://www.spatialys.com</a><o:p></o:p></pre>
<pre>My software is free, but my time generally not.<o:p></o:p></pre>
</div>
</body>
</html>