<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hi,</p>
    <p>in <a class="moz-txt-link-freetext" href="https://github.com/OSGeo/gdal/pull/8301">https://github.com/OSGeo/gdal/pull/8301</a>, I've added the
      capability to select/filter using the FID column name (when it is
      not empty) with the SQLite dialect as well.</p>
    <p>The behaviour of OGR SQL regarding FID use is documented at
      <a class="moz-txt-link-freetext" href="https://gdal.org/user/ogr_sql_dialect.html#fid">https://gdal.org/user/ogr_sql_dialect.html#fid</a> , and for the
      SQLite dialect at
      <a class="moz-txt-link-freetext" href="https://gdal.org/user/sql_sqlite_dialect.html#feature-id">https://gdal.org/user/sql_sqlite_dialect.html#feature-id</a></p>
    <p>Even<br>
    </p>
    <div class="moz-cite-prefix">Le 01/09/2023 à 10:28, Rahkonen Jukka a
      écrit :<br>
    </div>
    <blockquote type="cite"
cite="mid:AM0PR09MB32195A90364405963B8280DAFDE4A@AM0PR09MB3219.eurprd09.prod.outlook.com">
      <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;}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;}span.Shkpostityyli19
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}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]-->
      <div class="WordSection1">
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US">Hi,<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 style="mso-fareast-language:EN-US"
            lang="EN-US">Feature IDs are confusing. Some formats require
            FID, some do not directly support FID at all (shapefile).
            Sometimes FID must be an integer, sometimes it is always a
            string (gml_id), and sometimes it is either or (GeoJSON).
            Ogr2ogr has 3 parameters for FIDs, and vector drivers add
            their own options. Primary key acts usually as a FID, but
            can a composite PK be a FID? FIDs are really meant for the
            machines and GDAL usually hides FIDs, but they may be
            meaningful also for humans as well and sometimes users would
            like to expose them as a normal attribute with tricks like
            SELECT *, fid_field as my_fid.<br>
            <br>
            I agree that something like a dedicated wiki page about FIDs
            in GDAL would be nice to have. Maybe documenting how
            OBJECTID in FileGDB behaves with different SQL dialects is a
            rather small detail to be documented separately.<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US"
            lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US"
            lang="EN-US">-Jukka Rahkonen-<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US"
            lang="EN-US"><o:p> </o:p></span></p>
        <div style="border:none;border-top:solid #E1E1E1
          1.0pt;padding:3.0pt 0cm 0cm 0cm">
          <p class="MsoNormal"><b>Lähettäjä:</b> andy
            <a class="moz-txt-link-rfc2396E" href="mailto:aborruso@gmail.com"><aborruso@gmail.com></a> <br>
            <b>Lähetetty:</b> perjantai 1. syyskuuta 2023 9.54<br>
            <b>Vastaanottaja:</b> Rahkonen Jukka
            <a class="moz-txt-link-rfc2396E" href="mailto:jukka.rahkonen@maanmittauslaitos.fi"><jukka.rahkonen@maanmittauslaitos.fi></a><br>
            <b>Kopio:</b> gdal dev <a class="moz-txt-link-rfc2396E" href="mailto:gdal-dev@lists.osgeo.org"><gdal-dev@lists.osgeo.org></a><br>
            <b>Aihe:</b> Re: [gdal-dev] sqlite dialect: OpenFileGDB and
            FID Column selection<o:p></o:p></p>
        </div>
        <p class="MsoNormal"><o:p> </o:p></p>
        <div>
          <div>
            <p class="MsoNormal">Hi Jukka,<o:p></o:p></p>
          </div>
          <p class="MsoNormal"><o:p> </o:p></p>
          <div>
            <div>
              <p class="MsoNormal">On Fri, 1 Sept 2023 at 07:42,
                Rahkonen Jukka <<a
                  href="mailto:jukka.rahkonen@maanmittauslaitos.fi"
                  moz-do-not-send="true" class="moz-txt-link-freetext">jukka.rahkonen@maanmittauslaitos.fi</a>>
                wrote:<o:p></o:p></p>
            </div>
            <blockquote style="border:none;border-left:solid #CCCCCC
              1.0pt;padding:0cm 0cm 0cm
              6.0pt;margin-left:4.8pt;margin-right:0cm">
              <div>
                <div>
                  <div>
                    <p class="MsoNormal"
                      style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">When
                      the SQLite dialect is used, a temporary SQLite
                      database is created. OBJECTID is a feature
                      identifier (FID) and I guess that the FID gets
                      converted into a primary key with the SQLite
                      defaults. So maybe you can find the OBJECTID from
                      ROWID.<o:p></o:p></p>
                  </div>
                </div>
              </div>
            </blockquote>
            <div>
              <p class="MsoNormal"><o:p> </o:p></p>
            </div>
            <div>
              <p class="MsoNormal">it works, thank you very much.<o:p></o:p></p>
            </div>
            <div>
              <p class="MsoNormal"><o:p> </o:p></p>
            </div>
            <div>
              <p class="MsoNormal">Maybe a little related note in the
                documentation would do. What do you think about it?<o:p></o:p></p>
            </div>
            <div>
              <p class="MsoNormal"><o:p> </o:p></p>
            </div>
            <div>
              <p class="MsoNormal">Thank you again<o:p></o:p></p>
            </div>
          </div>
          <div>
            <div>
              <div>
                <div>
                  <div>
                    <div>
                      <div>
                        <div>
                          <div>
                            <div>
                              <div>
                                <div>
                                  <div>
                                    <p class="MsoNormal"><o:p> </o:p></p>
                                  </div>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </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>