<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Martin,</p>
    <p>Add the "-oo LIST_ALL_TABLES=YES" open option to your ogrinfo
      call: <a class="moz-txt-link-freetext" href="https://gdal.org/en/latest/drivers/vector/sqlite.html">https://gdal.org/en/latest/drivers/vector/sqlite.html</a></p>
    <p>(GPKG has a gpkg_contents table where non-spatial layers that are
      user facing are listed. There is no such thing in "pure" SQLite,
      and historically the driver has chosen to only list the ones
      registered in the geometry_columns table)<br>
    </p>
    <p>Even<br>
    </p>
    <div class="moz-cite-prefix">Le 30/10/2024 à 12:46, Martin Landa via
      gdal-dev a écrit :<br>
    </div>
    <blockquote type="cite"
cite="mid:CA+Ei1Oei+0Pf-nyqbYARFTfS44rLF5YGbj07cM2Do2PmJo9LwA@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div>Hi all,</div>
        <div><br>
        </div>
        <div>I have problem creating a new layer (no geometry) in SQLite
          data source:</div>
        <div><br>
        </div>
        <div>"""</div>
        <div>from osgeo import ogr<br>
          <br>
          driver_name = "SQLite"<br>
          filename = "test.db"<br>
          <br>
          driver = ogr.GetDriverByName(driver_name)<br>
          <br>
          with driver.CreateDataSource(filename) as ds:<br>
              layer = ds.CreateLayer("test", geom_type=ogr.wkbNone)<br>
              field = ogr.FieldDefn("label", ogr.OFTString)<br>
              layer.CreateField(field)<br>
          <br>
              layer_defn = layer.GetLayerDefn()<br>
              feat = ogr.Feature(layer_defn)<br>
              feat.SetField("label", "test")<br>
              layer.CreateFeature(feat)<br>
        </div>
        <div>"""</div>
        <div><br>
        </div>
        <div>Created datasource doesn't contain any layer, no errors
          reported. </div>
        <div><br>
        </div>
        <div>When I switch to GPKG driver, everything works fine:</div>
        <div><br>
        </div>
        <div>ogrinfo  test.gpkg test<br>
        </div>
        <div>...</div>
        <div>OGRFeature(test):1<br>
            label (String) = test<br>
        </div>
        <div><br>
        </div>
        <div>I have GDAL: 3.9.2, do you have any idea what is wrong?</div>
        <div><br>
        </div>
        <div>Thanks in advance for your help, best regards, Martin</div>
        <div><br>
        </div>
        <span class="gmail_signature_prefix">-- </span><br>
        <div dir="ltr" class="gmail_signature"
          data-smartmail="gmail_signature">
          <div dir="ltr">Martin Landa
            <div><a
href="https://geomatics.fsv.cvut.cz/en/employees/martin-landa/"
                target="_blank" moz-do-not-send="true"
                class="moz-txt-link-freetext">https://geomatics.fsv.cvut.cz/en/employees/martin-landa/</a><br>
              <a href="http://gismentors.cz/mentors/landa"
                target="_blank" moz-do-not-send="true"
                class="moz-txt-link-freetext">http://gismentors.cz/mentors/landa</a></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.
Butcher of all kinds of standards, open or closed formats. At the end, this is just about bytes.</pre>
  </body>
</html>