I want to convert a FGDB into an OGC Data format that: keeps domains and subdomains , keeps data types and is portable. Is this possible at all?Some answers below refer to geopackage, but I havent been able to automatically export domain/subdomain codes to the attribute table. I am after making an OGC version of a fully maintained FGDB, where some fields would have a dropdown menu with some codes, other fields would have a character limitation/type limitation, etc.
1 Answer
I'm not sure if there is an OGC format that would keep domains and subtypes for a converted fGDB as they are stored in the geodatabase system tables. Esri software is built to read the system tables and then apply the information to display the drop down lists etc.
What you might have to do is export the domains to tables using the domain to table geoprocessing tool and then use the tables as look up tables. Unfortunately there is no similar tool for subtypes, however you could read the subtype information using arcpy and dump it into a table from there.
subtypes = arcpy.da.ListSubtypes('Feature Class')
for stcode, stdict in list(subtypes.items()):
print('Code: {0}'.format(stcode))
for stkey in list(stdict.keys()):
if stkey == 'Name':
print('Name: {0}'.format(stdict[stkey]))
ogr2ogr -f gpkg output.gpkg input.fgdb