Difference between AGSCodedValueDomain and AGSInheritedDomain

519
3
05-14-2018 03:06 AM
MuruganandhamKuppan1
New Contributor III

In my previous version, i have fetched the coded values from the domains property of 'AGSFeatureType'. In latest iOS Runtime SDK, the new subclass of AGSDomain, 'AGSInheritedDomain' has been added and no domains value founded.

#2. What is the difference between  `AGSCodedValueDomain ` and AGSInheritedDomain

#3 Is there any way to get domain value form AGSInheritedDomain or to change the type from 'AGSInheritedDomain' to 'AGSCodedValueDomain'.

0 Kudos
3 Replies
Nicholas-Furness
Esri Regular Contributor

Hi Muruganandham Kuppan,

I need to find out more about the difference between the two, but this thread might be helpful to you.

Cheers,

Nick

0 Kudos
MuruganandhamKuppan1
New Contributor III

Hi Nick,

Is there any way to avoid the "AGSInheritedCodedDomain" while creating subtypes.  

Regards,

0 Kudos
Nicholas-Furness
Esri Regular Contributor

Hi Muruganandham,

If you're reading a subtype domain from an AGSFeatureType.domains and it's AGSInheritedDomain, you should look up the table's field (from which the domain will be inherited) with AGSArcGISFeatureTable.fieldForName() and read its domain property.

Note: The key to the AGSFeatureType.domains dictionary is the field name, so you can just pass that to AGSArcGISFeatureTable.fieldForName().

For example:

for featureType in table.featureTypes {
    guard let domains = featureType.domains else { continue }

    for (name,var domain) in domains {
        if domain is AGSInheritedDomain, let baseDomain = table.field(forName: name)?.domain {
            print("** \(name): Inherited Domain!")
            domain = baseDomain
        }
        // Now you've got the actual AGSCodedValueDomain or AGSRangeDomain…
    }
}

Sorry for the delayed response on this! Hope that helps.

Nick.

0 Kudos