[gdal-dev] Creating Feature Classes/Tables with XML_DEFINITION option via FileGDB and OpenFileGDB drivers

adamgutonski adamgutonski at protonmail.com
Fri Aug 26 12:42:24 PDT 2022


Hello,

I am having trouble when creating a feature class with subtypes and/or coded domains with the FileGDB or OpenFileGDB drivers, specifically when using the "XML_DEFINITION" or "DOCUMENTATION" layer creation option. I am simply creating a dataset and calling on CreateLayer:

lyr = ds.CreateLayer("TESTPOINT_2", geom_type=ogr.wkbPoint, options=["XML_DEFINITION/DOCUMENTATION=%s" % xmlstr])
ERROR 1: Failed at creating table for \TESTPOINT_2 (General function failure.)

xmlstr is read from a file containing the XML. The XML is based on FC_PCS_Point.xml found in the ESRI FileGDB API resources (in the XMLsamples folder) with added domain information.

My question is where and how to to structure the domain and subtype XML tag/information when using an XML string as part of the XML_DEFINITION or DOCUMENTATION layer creation options? The GDAL documentation specifically mentions that for the xml string that the " root node of such a XML definition must be a <esri:DataElement>". Where are the <Domain> and <Subtype> elements to be placed? Is the subtype and domain information only referenced in the Field elements? I can not seem to get any type of XML string to work beyond a simple feature class or table and have not been able to add subtypes or domains. I have attached the XML document that I am using to this email. Please see the <Subtypes> element under the root <esri:DataElement> as well as the <Domain> under the ELEVATION Field element. Any help or guidance would be greatly appreciated.

Kind regards,
Adam Gutonski

Sent with [Proton Mail](https://proton.me/) secure email.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20220826/f94539a5/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testAgain.xml
Type: text/xml
Size: 24629 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20220826/f94539a5/attachment-0001.xml>


More information about the gdal-dev mailing list