<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Jesse,</p>
<p>No it wasn't. Fix in <a class="moz-txt-link-freetext" href="https://github.com/OSGeo/gdal/pull/8247">https://github.com/OSGeo/gdal/pull/8247</a></p>
<p>Potential workaround: use a in-memory SQLite or GeoPackage with a
/vsimem/ filename</p>
<p>Even<br>
</p>
<div class="moz-cite-prefix">Le 21/08/2023 à 21:30, Meyer, Jesse R.
(GSFC-618.0)[SCIENCE SYSTEMS AND APPLICATIONS INC] via gdal-dev a
écrit :<br>
</div>
<blockquote type="cite"
cite="mid:AAF92069-4F84-4267-B83A-0CB9FC34D931@ndc.nasa.gov">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<style>@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:Monaco;
panose-1:0 0 0 0 0 0 0 0 0 0;}@font-face
{font-family:Menlo;
panose-1:2 11 6 9 3 8 4 2 2 4;}p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-ligatures:standardcontextual;}span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}div.WordSection1
{page:WordSection1;}</style>
<div class="WordSection1">
<p class="MsoNormal">Hi,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">This works:<o:p></o:p></p>
<p class="MsoNormal"
style="line-height:13.5pt;background:#2D2A2E"><span
style="font-size:9.0pt;font-family:Menlo;color:#FCFCFA;mso-ligatures:none">tc_lyr
</span><span
style="font-size:9.0pt;font-family:Menlo;color:#FF6188;mso-ligatures:none">=</span><span
style="font-size:9.0pt;font-family:Menlo;color:#FCFCFA;mso-ligatures:none">
</span><span
style="font-size:9.0pt;font-family:Menlo;color:#A9DC76;mso-ligatures:none">execute_SQL</span><span
style="font-size:9.0pt;font-family:Menlo;color:#939293;mso-ligatures:none">(</span><span
style="font-size:9.0pt;font-family:Menlo;color:#FCFCFA;mso-ligatures:none">tree_canopy_mem_ds</span><span
style="font-size:9.0pt;font-family:Menlo;color:#939293;mso-ligatures:none">,</span><span
style="font-size:9.0pt;font-family:Menlo;color:#FCFCFA;mso-ligatures:none">
</span><span
style="font-size:9.0pt;font-family:Menlo;color:#939293;mso-ligatures:none">"</span><span
style="font-size:9.0pt;font-family:Menlo;color:#FFD866;mso-ligatures:none">select
* from trees</span><span
style="font-size:9.0pt;font-family:Menlo;color:#939293;mso-ligatures:none">",</span><span
style="font-size:9.0pt;font-family:Menlo;color:#FCFCFA;mso-ligatures:none">
</span><i><span
style="font-size:9.0pt;font-family:Menlo;color:#FC9867;mso-ligatures:none">spatialFilter</span></i><span
style="font-size:9.0pt;font-family:Menlo;color:#FF6188;mso-ligatures:none">=</span><span
style="font-size:9.0pt;font-family:Menlo;color:#FCFCFA;mso-ligatures:none">c_geo)<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">However, this:<o:p></o:p></p>
<p class="MsoNormal"
style="line-height:13.5pt;background:#2D2A2E"><span
style="font-size:9.0pt;font-family:Menlo;color:#FCFCFA;mso-ligatures:none">tc_lyr
</span><span
style="font-size:9.0pt;font-family:Menlo;color:#FF6188;mso-ligatures:none">=</span><span
style="font-size:9.0pt;font-family:Menlo;color:#FCFCFA;mso-ligatures:none">
</span><span
style="font-size:9.0pt;font-family:Menlo;color:#A9DC76;mso-ligatures:none">execute_SQL</span><span
style="font-size:9.0pt;font-family:Menlo;color:#939293;mso-ligatures:none">(</span><span
style="font-size:9.0pt;font-family:Menlo;color:#FCFCFA;mso-ligatures:none">tree_canopy_mem_ds</span><span
style="font-size:9.0pt;font-family:Menlo;color:#939293;mso-ligatures:none">,</span><span
style="font-size:9.0pt;font-family:Menlo;color:#FCFCFA;mso-ligatures:none">
</span><span
style="font-size:9.0pt;font-family:Menlo;color:#939293;mso-ligatures:none">"</span><span
style="font-size:9.0pt;font-family:Menlo;color:#FFD866;mso-ligatures:none">select
* from trees</span><span
style="font-size:9.0pt;font-family:Menlo;color:#939293;mso-ligatures:none">",</span><span
style="font-size:9.0pt;font-family:Menlo;color:#FCFCFA;mso-ligatures:none">
</span><i><span
style="font-size:9.0pt;font-family:Menlo;color:#FC9867;mso-ligatures:none">spatialFilter</span></i><span
style="font-size:9.0pt;font-family:Menlo;color:#FF6188;mso-ligatures:none">=</span><span
style="font-size:9.0pt;font-family:Menlo;color:#FCFCFA;mso-ligatures:none">c_geo</span><span
style="font-size:9.0pt;font-family:Menlo;color:#939293;mso-ligatures:none">,</span><span
style="font-size:9.0pt;font-family:Menlo;color:#FCFCFA;mso-ligatures:none">
</span><i><span
style="font-size:9.0pt;font-family:Menlo;color:#FC9867;mso-ligatures:none">dialect</span></i><span
style="font-size:9.0pt;font-family:Menlo;color:#FF6188;mso-ligatures:none">=</span><span
style="font-size:9.0pt;font-family:Menlo;color:#939293;mso-ligatures:none">"</span><span
style="font-size:9.0pt;font-family:Menlo;color:#FFD866;mso-ligatures:none">SQLITE</span><span
style="font-size:9.0pt;font-family:Menlo;color:#939293;mso-ligatures:none">")</span><span
style="font-size:9.0pt;font-family:Menlo;color:#FCFCFA;mso-ligatures:none"><o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Returns:<o:p></o:p></p>
<p class="MsoNormal"><span
style="font-size:9.0pt;font-family:Monaco;color:#FCFCFA;background:#403E41">In
Initialize(): sqlite3_step(SELECT _rowid_, * FROM 'trees'
LIMIT 1): SQL logic error<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:9.0pt;font-family:Monaco;color:#FCFCFA;background:#403E41"><o:p> </o:p></span></p>
<p class="MsoNormal">Where execute_SQL =
ogr.DataSource.ExecuteSQL<o:p></o:p></p>
<p class="MsoNormal"><o:p></o:p></p>
<p class="MsoNormal">Which is naturally a surprise given that
I’m not explicitly asking for the rowid, nor to limit the
number of returned rows.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">The docs claim that the SQLite dialect can
be used with any OGR datasource, so I did expect this to
work. The input datasource is GeoPackage, which is based on
SQLite, so I assume my install is built with SQLite, though
I’d welcome advice on how to explicitly demonstrate this. <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">My GDAL version install is 3.6.4, on OSX
13.5.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks,<o:p></o:p></p>
<p class="MsoNormal">Jesse<o:p></o:p></p>
</div>
<br>
<fieldset class="moz-mime-attachment-header"></fieldset>
<pre class="moz-quote-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>
<pre class="moz-signature" cols="72">--
<a class="moz-txt-link-freetext" href="http://www.spatialys.com">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
</body>
</html>