Select to view content in your preferred language

symbology from feature class/layer in mobile geodatabase (.geodatabase) in Pro?

744
5
10-05-2023 11:03 AM
PaulCone2
Frequent Contributor

We have a map for our first responders that uses a mobile geodatabase (.geodatabase) file.  In ArcMap, you could Share As... ArcGIS Runtime Content and get an item in the geodatabase that maintained the symbology of the layer, when added to the runtime application.

In ArcGIS Pro, I'm using arcpy.management.CreateMobileGDB and then arcpy.conversion.ExportFeatures.  How can I get the symbology into the mobile geodatabase so the runtime can display it?  When I look at the .geodatabase file in Pro that was created in ArcMap I don't see how/where any symbology is stored, but it must be there because the runtime displays it.

5 Replies
LemuelM-MDC
Emerging Contributor

Hi PaulCone2. Were you able to resolve this. I have the exact same case. I have a solution where I created Runtime Content from an .MXD document with the layers pointing to SDE and symbolized as needed for display in an Android SDK application. Now I am tasked to convert the solution to ArcGIS Pro. I have not found anything in ESRI documentation to create using python a mobile GDB ".geodatabase" from an ArcGIS Pro map document, so I tried combining arcpy.management.CreateMobileGDB and then arcpy.conversion.ExportFeatures, but then for the symbology in the ".geodatabase" I just see the default simple points and lines from the SDE feature classes. Any advice on how to accomplish adding the FeatureClasses to the mobile GDB while maintaining a different symbology that the default simple point and line from SDE? Thank you so much in advance. 

0 Kudos
PaulCone2
Frequent Contributor

I have not resolved this.  I was hoping someone from ESRI would weigh in here.  In the meantime we are continuing to use .geodatabase generated from ArcMap.

0 Kudos
LemuelM-MDC
Emerging Contributor

Thank you PaulCone. I posted the same question in the Python Questions Community  and got a suggestion from a community contributor to try using the arcpy.management.ApplySymbologyFromLayer after I create the new ".geodatabase" with the desired featureclasses in it using the combination of  arcpy.management.CreateMobileGDB and then arcpy.conversion.ExportFeatures. I have not trid the suggestion yet, I wonder if the arcpy.management.ApplySymbologyFromLayer would only apply layer symbology but not other layer properties like labeling, as I think the arcpy.management.CreateRuntimeContent did all in on call with an MXD as the input. I just got that reply so I still need to test that myself.

PaulCone2
Frequent Contributor

Hi again @LemuelM-MDC -- were you able to get this to work?  I finally got around to using Apply Symbology from Layer in Pro (3.1) and I still just get a black dot in my runtime application -- no custom symbol.

0 Kudos
PaulCone2
Frequent Contributor

Thank you Lemuel.  Assuming that works for the symbology, I can deal with bad labels.  I already get complaints about it (e.g. letters running together) and my response is, it's MapBox's spec.  I will give ApplySymbologyFromLayer a try.

Paul

0 Kudos