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?
Page 1 / 1
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?
@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.
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.