I am querying Features from a Feature Layer and then calculating/setting new values on the Feature for one of its Fields. The issue is that the Feature Tables/Features on my layer cannot be edited (IsEditable is set to false). I saw a post (mobile package, feature layers are not editable - Esri Community) from 2017 where one user reported that all Mobile Map Packages from ArcPro are read-only. Is this still the case? Is there no workaround? In the post they mention using OfflineMapTask.CreateAsync() but this requires a portal which I do not have and cannot get access to in my work environment.
The workflow:
I created a stylized Feature Layer with a Class Breaks renderer in ArcPro. This layer represents data recordings at locations all over the globe. It has several fields for each of these readings and an additional "Interpolated" field. The idea is to take these static readings and combine it with a user specified/calculated value to generate a new value for which to display. The class breaks renderer is set to display the interpolated column. So, I package this layer as an MMPK -> send to my users alongside my Maps SDK tool -> they perform calculations -> In code I modify the interpolated field for select features -> the display updates.
Software:
ArcPro 3.0.3 with an Advanced license (including the publisher extension)
ArcMaps SDK 200.5
ArcGIS Pro Map packages are not edible, you need to generate replicas. There are numerous methods for doing this
Thanks for the tip! I had never heard of replicas/replication before in this context.
After some research and testing it seems that you can only create replicas of datasets/databases in an Enterprise Geodatabase? My data is stored in a local File Geodatabase.
I tried to migrate my data to my SQL Server but I could not create an Enterprise Geodatabase without an ArcGIS Server, which I do not have and cannot get in my work environment.
I don't understand why my local copy of the data would be locked to read-only anyways. Feels like I am missing something.
Please correct me if I am wrong on any of this.
Thanks!
Yes, to take data for editing offline you need an enterprise geodatabase.
An option for testing might be to try putting the data in AGOL. I believe you can create a dev account with trail AGOL subscription. You could copy the data up there. You can then use the API to take a web map offline (which is probably the most straight forward way).
From a file GDB, though, I am not aware of any way you could take editable data offline.
You might be able to open it up like a zipfile and see .geodatabase contents and do some wrangling. I'm not sure if these files are somewhat different from Mobile Geodatabases and are 'Runtime' geodatabases with certain limitations (such as editing). Would be interested to know more about what's inside of the MMPKs and what might be possible.
You can unpack the MMPKs and inside they do have Mobile Geodatabase (*.geodatabase) for the layers in the package, but this has the same issue. All the FeatureLayer's FeatureTables are read-only.
I understand that you have defined a renderer in ArcGIS pro and published an MMPK and would like to edit the data, and as you have noted, this is currently not possible. Data in MMPKs is read only.
The easiest workflow would be create an independent mobile Geodatabase for runtime use. You should be able to edit the data in a mobile geodatabase and share edits across.
Mobile geodatabases are editable. They are designed to store, query, and manage both spatial and nonspatial data, and they support both viewing and editing. This allows for offline editing workflows that do not require a feature service.
In regards to symbolizing the data, you can add logic to define a renderer in your client app. You can actually copy the renderer json from MMPK by unzipping it and then use Renderer.FromJson() to create a renderer and apply it to the layer.
Hope this helps!
I just tried packaging the data into a mobile geodatabase and noticed that FeatureTable.IsEditable was still set to false. I have not tried actually editing the Features yet. I may have also packaged it wrong (In ArcPro: Run the Create Mobile Geodatabase tool -> Right-click the new database -> Import -> Feature Classes -> select my layers).
We send several different data packages to our users. We opted to use MMPKs because it allows for structured and fully stylized layers with group layers, symbology, definition expressions, labels, ect. MMPKs are perfect for all of our purposes excluding editing since it allows us to send new data without the need for hard-coded definitions or any other supplemental files that could potentially get lost/corrupted. It's convenient having the all-in-one solution in MMPKs.
With that said, if the only solution is to package this data as a mobile geodatabase and then implement some code specific to the data, then that's fine we can make that work.
Do you have any other ideas that could serve as a 'hack' for unlocking the MMPKs, inside or outside of ArcPro? Or is this fully impossible? I just want to be aware of all our options before deciding on a path.
Thanks for the help!
That's a very valid workflow and use-case. There are no current plans to add this support in recent future but the idea to enable editing data in an MMPK is under consideration. Here is ArcGIS Idea I am referring to : https://community.esri.com/t5/arcgis-maps-sdks-native-ideas/ability-to-edit-non-sync-enabled-mmpk/id... for the similar workflow as yours. I would recommend up voting to increase the priority of the use case. I will also add the information you have provided to our internal issue.
Unfortunately, at the moment there are no hacks or workarounds available around enabling MMPKs. If I find something I will definitely let you know.
Thanks for reaching out and sharing your ideas.
@JBuchanan thanks for reaching out about editing feature data in mmpks. Like Preeti mentioned, this is currently not possible, and your other option would be to create a standalone mobile gedatabase in ArcGIS Pro, and separately manage the symbology of the data by defining a renderer in your app's code.
I have a follow up question about your editing workflow - once your users make edits to their copy of the data, do you intend to consolidate all of their edits? Will someone grab the databases off their devices and transfer edits into a central database? Will they be editing existing data, and if so how will you ensure they don't make conflicting changes? Or will they only be creating new data?