Subtypes in runtime Geodatabases

1962
12
08-30-2017 07:42 AM
EdwardBlair
Occasional Contributor

I'm probably missing something, but is there support for subtypes and subtype-specific domains in the runtime Geodatabase?  From what I see if a field has a domain assigned at the class level that domain assignment is respected, but I don't see anything that is aware of a domain assigned at a subtype level.

Any info would be much appreciated.

Thanks,

Ed

0 Kudos
12 Replies
JoeHershman
MVP Regular Contributor

Nope ain't there.  This caught me by surprise too.  But the services do not include Subtype info so there is no way for the replica to find it.  There is a TypeIdField property on the FeatureTable object.  If they symbolize on Subtye this would be the Subtype.  But if they don't symbolize on Subtype no luck.  Who let you start to program again (assuming this is the right Ed)?

Good Luck

-Joe

Thanks,
-Joe
0 Kudos
EdwardBlair
Occasional Contributor

Joe -

Thanks much for the response!

My issue isn't about symbolization but rather about resolving domains

defined at the subtype level. If this is a gap, then it seems like a

pretty big one. But we'll muddle through.

And, yes, this is the Ed you're thinking of. Who wouldn't want to program

if you've got the opportunity?

Thanks again,

Ed Blair

0 Kudos
JoeHershman
MVP Regular Contributor

So the Field:Domain property is always the default field domain?  I agree not having Subtype info is a big gap.  We need to show the textual value of the Subtype field and ran into the same issue.  I used the above description as a work-around but it is kind of a hack, imo.  Hope all is well, eat some pizza in Chicago for me if you are going next week

Thanks,
-Joe
0 Kudos
MarkCederholm
Occasional Contributor III

ArcGIS server 10.5 adds subtype support to feature services.  I haven't tested one to see if the Runtime GDB has the subtypes.

0 Kudos
JoeHershman
MVP Regular Contributor

MCederholm‌ can you point me to that in the service definition?  For what I need I could just hit the server to get it myself, but I don't see anywhere in the service definition.  I have some cases where the subtype field is not SUBTYPECD and I need to store that in a configuration that gets built out.

Cheers

-Joe

Thanks,
-Joe
0 Kudos
MarkCederholm
Occasional Contributor III

Update2: I just looked at a feature layer created from a 10.5 feature service, and the subtypes are correctly populated in FeatureTypes.  So I would assume that a Runtime GDB created from it would reflect that.  However, I looked at a feature layer loaded from an MMPK, and FeatureTypes is based on the symbology, not the subtypes.

MarkCederholm
Occasional Contributor III

One possible workaround for feature services earlier than 10.5 would be to get the sublayer info from the corresponding map service, which has the subtypes correctly populated.  I'm not sure what I can do about the MMPK problem: that may be an ArcGIS Pro bug.

JoeHershman
MVP Regular Contributor

Thanks for the pointer, I had not really dove into the full json from the feature service definition, but I can get what i need by pulling that and combining with the general webmap json

Thanks,
-Joe
0 Kudos
MarkCederholm
Occasional Contributor III

There's no need to do any JSON parsing in this case, unless you really want to improve performance.  If you don't mind the extra baggage, you can populate a ServiceFeatureTable from the Url of the map service sublayer and get the ArcGISFeatureLayerInfo:

          private async void GetWebFeatureTypes(string sMapServiceSublayerUrl)
          {
               ServiceFeatureTable sfTab = new ServiceFeatureTable(new Uri(sMapServiceSublayerUrl));
               await sfTab.LoadAsync();
               ArcGISFeatureLayerInfo flInfo = sfTab.LayerInfo;
               StringBuilder sb = new StringBuilder();
               sb.Append("\nType Field: " + flInfo.TypeIdFieldName);
               foreach (FeatureType fType in flInfo.FeatureTypes)
                    sb.Append("\nType " + fType.Id.ToString() + ", '" + fType.Name + "'");
               MessageBox.Show(sb.ToString());
          }
‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

Of course, you need to grab this information while connected, and store it for the offline session.

0 Kudos