<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Adam,</p>
    <p>I've just clarified the doc to explain that it is read-only for
      the FileGDB driver.</p>
    <p>The FileGDB SDK itself seems to have support for writing too, but
      this isn't implemented in the driver currently. Left as an
      exercise to the contributor as one says.<br>
    </p>
    <p>Even<br>
    </p>
    <div class="moz-cite-prefix">Le 11/04/2022 à 19:13, adamgutonski via
      gdal-dev a écrit :<br>
    </div>
    <blockquote type="cite"
cite="mid:vYVPa2jR3jCcv3vc1SgMWKxIOCM0mCX-K_kJH8pOAZnStxv4PAopeOpE9h5COKy5KjD2RFyIin287CiAS85bQKmeLvB6W-_q006I2DQzuUY=@protonmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div style="font-family: arial; font-size: 14px;">I am wondering
        how can one add a coded field domain to a file geodatabase using
        the FileGDB driver and File GDB API?  Anytime I call
        AddFieldDomain it returns false:</div>
      <div style="font-family: arial; font-size: 14px;"><br>
      </div>
      <div style="font-family: arial; font-size: 14px;"><span>>>>
          coded_domain = ogr.CreateCodedFieldDomain("name", "desc",
          ogr.OFTString, ogr.OFSTNone, {1:'LOW'})</span>
        <div><span>>>> driver = gdal.GetDriverByName("FileGDB")</span></div>
        <div><span>>>> datasource =
            driver.Create(r'C:\output\test_domains.gdb', 0, 0, 0)</span></div>
        <div><span><b>>>>
              datasource.AddFieldDomain(coded_domain)</b></span></div>
        <div><span><b>False</b></span></div>
        <div><span><b><span>>>>
                datasource.TestCapability(ogr.ODsCAddFieldDomain)</span><br>
              <span>False</span><br>
            </b></span></div>
      </div>
      <div style="font-family: arial; font-size: 14px;"><br>
      </div>
      <div style="font-family: arial; font-size: 14px;">The
        documentation suggests that the FileGDB driver is capable of
        supporting domains as of 3.3: <span><a target="_blank"
            rel="noreferrer nofollow noopener"
href="https://gdal.org/drivers/vector/filegdb.html?highlight=domains#field-domains"
            moz-do-not-send="true" class="moz-txt-link-freetext">https://gdal.org/drivers/vector/filegdb.html?highlight=domains#field-domains</a></span></div>
      <div style="font-family: arial; font-size: 14px;"><br>
      </div>
      <div style="font-family: arial; font-size: 14px;">I am using gdal
        version 3.4.2.</div>
      <div style="font-family: arial; font-size: 14px;"><br>
      </div>
      <div style="font-family: arial; font-size: 14px;">Am I adding the
        domain incorrectly, or does this mean that domains are not
        supported with the FileGDB driver?</div>
      <div style="font-family: arial; font-size: 14px;"><br>
      </div>
      <div style="font-family: arial; font-size: 14px;">Thank you,</div>
      <div style="font-family: arial; font-size: 14px;">Adam Gutonski</div>
      <div class="protonmail_signature_block" style="font-family: arial;
        font-size: 14px;">
        <div class="protonmail_signature_block-proton"> </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>