[GIS] Converting file geodatabase with coded domains to PostgreSQL / PostGIS

convertenterprise-geodatabasefile-geodatabasepostgispostgresql

We have several file gdb's and would like to convert these to Postgres / PostGIS. We've used ogr2ogr to transfer these files; however, some of the fields are stored as coded domains and the fields are not decoded in the transfer. Coded domains are stored in a separate table.

For example, a column design quality could belong to the general domain quality. Quality could then be coded as '1=low, 2=medium, 3=high'. This is to enforce that only certain values are used, for instance in a survey. Ogr2ogr reads the values 1, 2, and 3, but not the accompanying text.

Would anybody know how to include these domains in the transfer from gdb to Postgres / PostGIS?

We could convert to file gdb's to an ArcSDE database if this is easier; however shapefiles are not preferred due to column truncation.

This question was posted earlier here on StackOverflow.

Best Answer

Well, before you convert the database, you could run the Domain to Table geoprocessing tool http://resources.arcgis.com/en/help/main/10.1/index.html#/Domain_To_Table/001700000022000000/ which should convert a domain to a stand-alone table that you could put in the database. Then, you should be able to just convert the database, including stand-alone tables in the database. Finally, at the end (or before you do the database conversion for that matter), you could do a join between the Feature Class attribute tables and the domain table, or you could even use a join to calculate the domain description value into the relevant feature classes as a new field. Anyway, I hope that gives you some ideas, and let me know if it doesn't make sense and I'll try and clarify.