I have a requirement for my .NET MAUI application that I need to access a feature service from the client's Enterprise Portal and make it available to the user when their device is offline later.
I started with geodatabase as a potential solution, but creating and managing replicas turned out to be a bigger headache for the client than I thought. Otherwise, geodatabases would've been a perfect solution. Is there a way to create a geodatabase with a feature service WITHOUT creating a replica?
I won't use MMPKs, because I just need to take a single layer online. There are also other requirements for the application that prevents us from using MMPKs here.
Is my best option to create a ServiceFeatureTable and then export the features to a custom .sqlite database and then load them into the map page?
Or is this a workflow better done using REST to export features from the service to a .geojson and then somehow load them into the map?
Thanks for the help! I would be at DevSummit this week asking the Maps SDK team myself, but unfortunately, couldn't make it out there this year. Community ESRI is the next best option!
Solved! Go to Solution.
You could roll your own version of sync sure, but the entire replica process is there for this exact scenario to ensure multiple users won't modify the same feature, keep track of what changed, and sync new edits both up and down.
> It seems like we cannot use Maps SDK for .NET to query any of this information
This is a REST endpoint. It wouldn't be a lot of work querying and parsing this information. .NET provides lots of great APIs to work with REST and JSON. My guess is that is probably a lot less work than trying to build your own sync framework.
The replica id itself is available on the geodatabase: https://developers.arcgis.com/net/api-reference/api/net/Esri.ArcGISRuntime/Esri.ArcGISRuntime.Data.G...
Hi Kevin,
Would you be able to use a webmap that is enabled for offline use in your application?If your application involves editing data, this may be a more convenient option.
https://doc.arcgis.com/en/arcgis-online/manage-data/take-maps-offline.htm
Mark
Thank you for your response @MarkBockenhauer .
Assuming all the layers in the client's webmap are approved for offline use...
If we were to take the webmap offline, we'd have to use an on-demand workflow, due to the different map areas that users would need to take offline. But also not sure how scalable this solution is to a large number of users, each of whom would need to take a different area offline.
I started with geodatabase as a potential solution, but creating and managing replicas turned out to be a bigger headache for the client than I thought. Otherwise, geodatabases would've been a perfect solution. Is there a way to create a geodatabase with a feature service WITHOUT creating a replica?
Could you elaborate on that a little more on what issues you're encountering? Creating a replica of your geodatabase is the suggested workflow.
We were able to create geodatabase replicas using Feature Service URLs. And these replicas show up on Enterprise in the list of replicas for the service. Great!
But the problem is that the client has some complex workflows around data-sync between different staging environments that requires deleting all replicas and recreating them every few weeks. If the replicas are re-created, there is no way to associate the device-local geodatabase replicas to their replica-pairs in Enterprise. When we check the replica page, we see Replica name, ID, version etc. It seems like we cannot use Maps SDK for .NET to query any of this information. Furthermore, I cannot use the Geodatabase class to get the name or ID of replica in server that was just created. Am I correct? Is there a way to get replica ID using the SDK?
Basically, there seems to be no way to know which device-local geodatabase replica is associated with which replica in the server.
Thanks! Any insight appreciated!
Are you not planning to sync any local changes back to the server? If so the preplanned workflow might be better for you.
We'd like to sync local changes to the service as well, but we were planning on using the SDK's ApplyEdits if the geodatabase replica workflow didn't pan out.
I think preplanned workflow is out of the question because we don't know which areas of the map users will be performing work in.
I think the best solution we have right now is a custom implementation of local databases that store attribute and geometry data:
You could roll your own version of sync sure, but the entire replica process is there for this exact scenario to ensure multiple users won't modify the same feature, keep track of what changed, and sync new edits both up and down.
> It seems like we cannot use Maps SDK for .NET to query any of this information
This is a REST endpoint. It wouldn't be a lot of work querying and parsing this information. .NET provides lots of great APIs to work with REST and JSON. My guess is that is probably a lot less work than trying to build your own sync framework.
The replica id itself is available on the geodatabase: https://developers.arcgis.com/net/api-reference/api/net/Esri.ArcGISRuntime/Esri.ArcGISRuntime.Data.G...
Ok, the syncId property is exactly what I was looking for. Yes, we query REST endpoints elsewhere in the app, so we're fine with those workflows.
I think I searched for replicaId in the docs, and got zero results. I'll be going with this workflow instead. Thank you for pointing it out!
@dotMorten_esri After discussing with my client, it seems like they want the ability to download pre-created (created from server, not mobile) replicas to the mobile app. Allowing hundreds of field workers to each create replicas is unmanageable when taking into account the bi-weekly data sync workflows I mentioned in my earlier comment. So they want to create replicas server-side and then the mobile app goes and downloads them.
This is more an enterprise question and less a Maps SDK issue at this point, so I'm in the wrong place, but... Is there any way to download replica .geodatabase using REST request? I searched around the replica REST page and I can't find a way to do this.