subtypes in runtime gdb

3397
2
08-29-2014 10:59 AM
ForrestKaye
New Contributor III

I cannot track down subtypes in the runtime gdb.  I've used a CVD from geodatabase.getEditableAttributeFields() and works fine, but the subtypes do not seem to be stored in the same way as a cvd.

0 Kudos
2 Replies
DanO_Neill
Occasional Contributor III

If you have sub-types in your feature service you get them in the runtime geodatabase at the feature table level.  Use GeodatabaseFeatureTable.getFeatureType() to return the types available.  Then you can Geodatabase.createFeatureWithType() to create new features of that type.  See API Ref here > GeodatabaseFeatureTable | ArcGIS Android 10.2.3 API .

ForrestKaye
New Contributor III

Thanks for the reply.  It was very helpful but I am still stuck.

I have found the Subtype and associated CVD through the methods described above.  However, I cannot find which fields they are associated to.  Type -- associated with field_x?

What I am trying to to is link a field in a form to the subtype, and a separate field in the same form with the Coded value domain per the subtype.  I have a form already populated with all of the feature attributes but can't find a way to link the fields with the subtype/CVD now.  I know that my type is associated with my field FEATURE_TYPE however I cannot figure that out from either return value.

Here is what I get when I return getFeatureTypes():

[Type: [ id: 0, name: HumanFeature, domains: {FEATURE=CodedValueDomain: [ domainName:dom_AllFeatures_HumanFeatures_Ca codedValues:{Cultural=Cultural, Culvert=Culvert, Gate Cattleguard=Gate Cattleguard, GTLF=GTLF, Guzzler=Guzzler, Land Treatment=Land Treatment, Mine=Mine, Monitor Measure=Monitor Measure, Sign=Sign, Well=Well, Other AssetFacility=Other AssetFacility, Other Barrier=Other Barrier, Other Forestry=Other Forestry, Other Fire=Other Fire, Other HazMat=Other HazMat, Other Hydro=Other Hydro, Other Minerals=Other Minerals, Other Range=Other Range, Other Recreation=Other Recreation, Other Transport=Other Transport, Other Wildlife=Other Wildlife, Other=Other} ]}], Type: [ id: 1, name: NaturalFeature, domains: {FEATURE=CodedValueDomain: [ domainName:dom_AllFeatures_NaturalFeatures_Ca codedValues:{Barrier=Barrier, Fauna=Fauna, Flora=Flora, Geologic=Geologic, Hydrologic=Hydrologic, Monitor Measure=Monitor Measure, Paleo=Paleo, Spring=Spring, Other=Other} ]}], Type: [ id: 2, name: HumanEvent, domains: {FEATURE=CodedValueDomain: [ domainName:dom_AllFeatures_HumanEvent_Ca codedValues:{Explosive=Explosive, Fire=Fire, Hazmat=Hazmat, LawEnforcement=LawEnforcement, Recreation=Recreation, Other=Other} ]}], Type: [ id: 3, name: NaturalEvent, domains: {FEATURE=CodedValueDomain: [ domainName:dom_AllFeatures_NaturalEvent_Ca codedValues:{Astronomic=Astronomic, Fire=Fire, Geologic=Geologic, Hydrologic=Hydrologic, Meteorologic=Meteorologic, Other=Other} ]}], Type: [ id: 4, name: Other, domains: {FEATURE=CodedValueDomain: [ domainName:dom_AllFeatures_Other_Ca codedValues:{Other=Other} ]}]]

Here is what I get when I return getEditableAttributeFields():

[Field [name=FEATURE_TYPE, alias=Feature_Type, type=esriFieldTypeSmallInteger, type_int=20, editable=true, length=0, ], Field [name=FEATURE, alias=Feature, type=esriFieldTypeString, type_int=60, editable=true, length=50, ], Field [name=NOTES, alias=Notes, type=esriFieldTypeString, type_int=60, editable=true, length=100, ], Field [name=BUFFER_FT, alias=Buffer_ft, type=esriFieldTypeInteger, type_int=10, editable=true, length=0, ], Field [name=DISTURBANCE_PCT, alias=Disturbance_Pct, type=esriFieldTypeInteger, type_int=10, editable=true, length=0, ]]

Thanks for any more assistance you can provide.

0 Kudos