2

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.

  • Coded domains are the equivalent of constraints in a db? – John Powell Jul 12 '14 at 13:22
  • 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 and not the accompanying text. – Michael Jul 14 '14 at 2:08
  • If you have SDE just copy/paste using ArcCatalog. Copies the data, domains and subtypes. – Michael Stimson Jul 14 '14 at 2:14
  • This PostgreSQL/PostGIS answer to an Oracle question may help: gis.stackexchange.com/questions/10397/… – PolyGeo Jul 14 '14 at 3:26
  • Database domains aren't necessarily recognized by the consuming program. The issue here is that descriptions are text and the values are (usually) numeric. That would involve a fundamental change of data type for the field. You can export your domains to table, join and then export to lock in the values but then you end up with two fields, one numeric and the other text, describing the same information... to easy to get out-of-step, best to delete the numeric field after exporting if you want the text. – Michael Stimson Jul 14 '14 at 3:33
2

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.

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.