2

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
    why not a geopackage? – Ian Turton Oct 16 at 14:41
  • Is it possible to convert FGDB to geopackages? If yes, that would be the answer! – Roberto Zeeland Oct 16 at 14:43
  • 2
    ogr2ogr should handle it – Ian Turton Oct 16 at 14:44
  • 2
    Syntax should be ogr2ogr -f gpkg output.gpkg input.fgdb – user30184 Oct 16 at 15:09
  • With this approach domains are not kept in the new geopackage. Let me clarify my question with an example: I have one feature in the FGDB which refers to seabed. One of its attributes defines the seabed type, here you are supposed to enter an integer from 1 to 28 -which then refers to a seabed type- . This happens with all of the features, they have at least one attribute relating to a domain/subdomain. Any ideas on how to keep this information? – Roberto Zeeland Oct 17 at 6:34
1

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]))
  • Please don't sign-off using "Cheers", or anything, because it constitutes chit chat and goes against the Tour. – PolyGeo Oct 17 at 22:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.