Skip to main content
Question

Preserve Domain

  • February 25, 2025
  • 4 replies
  • 47 views

asali
Contributor
Forum|alt.badge.img+1
  • Contributor

Hi,

Could anyone please guide me on how to preserve the domain as it is when a feature class with domain for multiple fields is read using SDE reader, and then when it is written to a SDE Writer.

When i look at the fields of the output feature class, the domain is empty. How can i overcome this?

4 replies

nielsgerrits
VIP
Forum|alt.badge.img+54

I seldom use domains in SDE so I’m not sure. But do you create a new featureclass using the featurewriter and insert there or do you insert in an existing featureclass where the domain is already configured for the column?

Also see the article Working with Geodatabase Domains: Writing A Coded Domain


asali
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • February 25, 2025

@nielsgerrits 
Actually, i am reading feature class from database using the ArcSDE reader, and this feature class has multiple fields which has domain. Now i want to write this to a new feature class, but when i do this and check fields in data design in the “Domain” is empty. I hope you understood what i meant. The below picture shows the field data design of input feature class.


 

from the article, what is understood is (sorry, correct me if i am wrong) one method is resolving, which is creating new fields, that is not what i want. Then the next method is writing coded domain one by one. which is not possible. Moreover of i have to schedule this workspace, so if any new field with domain comes, it should also be copied.


nielsgerrits
VIP
Forum|alt.badge.img+54

Again, this is not something I do on a daily basis, but I believe creating a new featureclass where domains are assigned to fields is not possible, out of the box. I think you’ll need Python to do so. Probably something like:

  • PythonCaller to get list of domains assigned to fields in original featureclass(es).
  • SchemaScanner to generate schema feature.
  • Sampler to sample 1 feature.
  • FeatureWriter to create the featureclass using one feature. If this needs to be dynamic, you also want a schema feature from the SchemaScanner.
  • PythonCaller to assign the domain(s) to the field(s) and remove the first feature.
  • FeatureWriter to insert all features.

I have not tried this before, would assume it is doable, but it is not easy.


asali
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • February 27, 2025

@nielsgerrits 

Ok thank you, let me try it.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings