Select to view content in your preferred language

Create mobile geodatabase (.geodatabase) with python and ArcGIS Pro document, maintaining layers symbology.

678
1
02-14-2024 05:52 PM
LemuelM-MDC
New Contributor II

I have a python script where I created a RuntimeContent with arcpy.management.CreateRuntimeContent as shown below using an MXD with the layers pointing to SDE and symbolized as needed for display in an Android SDK mobile application. Now I am tasked to convert the solution to python 3.7 and ArcGIS Pro. I have not found anything in ESRI documentation to create using python a mobile GDB ".geodatabase" in a similar way using and 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 (.geodatabase) while maintaining the symbology in an ArcGIS Pro map document where the symbology is different than the default simple point and line from SDE? Thank you so much in advance.

arcpy.management.CreateRuntimeContent(mxdPath, outFolder, **params)

0 Kudos
1 Reply
MollyWalkner_1
New Contributor II

Not quite sure if this is what you're looking for, but after the export to the new geodatabase, you can use arcpy.management.ApplySymbologyFromLayer to import the symbology from each SDE layer to the corresponding layer in the new geodatabase.

Additional Info: https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/apply-symbology-from-layer.h...

0 Kudos