Hi
How do I make programmatic edits, like this one, in a local .shp og .gdb file?
Do I need to import it into .geodatabase first? If so, how?
private async void searchLocalGDB(string Path1, string Path2)
{
// Open the geodatabases
var gdbRead = await Esri.ArcGISRuntime.Data.Geodatabase.OpenAsync(Path1);
var gdbWrite = await Esri.ArcGISRuntime.Data.Geodatabase.OpenAsync(Path2);
// Get the first tables in the DB's
var gdbWriteTable = gdbWrite.FeatureTables.FirstOrDefault();
var gdbReadTable = gdbRead.FeatureTables.FirstOrDefault();
// Set up filter, returning the first 7 rows
var filter = new Esri.ArcGISRuntime.Data.QueryFilter();
filter.MaximumRows = 7;
filter.WhereClause = "1=1";
// Query the Read table, and add to the write table
var Q1 = await gdbReadTable.QueryAsync(filter);
foreach (Esri.ArcGISRuntime.Data.GeodatabaseFeature F in Q1)
{
await gdbWriteTable.AddAsync(F);
}
}
The short answer is that Runtime currently doesn't support editing local data (i.e. shapefiles and file geodatabase data) directly. You could get the data into Runtime, but without using the synchronization workflow via a Feature Service you wouldn't be able to easily persist your changes back to the parent feature.
If you did want to edit local data without a sync-enabled service you'd have to use workflows where you load the data into runtime, manipulate the data, and then create new copies of it to persist the changes. These changes could not be returned to the original feature class. This approach could be accomplished using one of the following technologies.
Hi Freddie , it is interesting what you say in particular "NOTE: I have a sample that display show to edit map packages if you need to review this workflow." .
Mpk file is actually an archive 7zip , can you suggest a sample for edit map packages ?
Thanks you
Hi,
i need to write an application for edit feature from a .mpk map package.
How i can locate the local folder where the mpk will be extracted?
And how i can save the changes to the original mpk?
Maybe your example it could be of help.
Thank you in advance
I'll look through my sample to see if I can find this specific sample. For the most part you wouldn't be able to manipulate the original map package, but you could overwrite it with the updated data where the package was extracted. You would accomplish this by locating where the package is extracted and zipping these updated files to persist the edits. Someone could retrieve the data from the zip file if need, but if they wanted to see the changes reflected in a map package I would need to overwrite the original map package by uploading the zipped folder to a geoprocessing service that could un-zip it, call the package map tool to create a new map package, and then download this to the clients machine. Do you think this workflow is something that'd work for you?
Yes it could work.
I didn't find a geoprocessing to re-create the mpk, the only geoprocessing is the "Package Map" but when i try to share for use it in a local server, it says me that "Tool Package Map is not licensed for use inArcGIG Runtime package" (and i have a full enteprise license, with sdk and engine (edn)). Another problem is that when the Arcgis runtime for .net extracts the mpk in the temporary folder it adds a random guid at the end of the folder name.
All these problems make me think to discard arcgisruntime for .net in favor of arcobject/engine solution, but with arcobject/engine i will work with an older developing environment (winform and com components) that limits the graphics capabilities of a .net application. Another way could be to work with arcgispro sdk but the application will became an add-in of arcgis pro and the sdk is in beta release.
So i think the sceneario/workflow you have describe in a real example could be helpfull.
Thank you in advance
The package map tool isn't supported for offline use in Runtime. You would only be able to utilize it in a connected environment from runtime. Could you describe the workflow you're needing to accomplish in more detail?
Yes of course,
the application must be able to:
1) map editing (editing a layer created from a shapefile ),
2) create, store and mantain a local geodatabase file,
3) mosaic raster data (tiff),
4) store features, raster image (tiff) and mosaic dataset in a local geodatabase,
5) analysis ndvi,
all these requirements must be made in a off-line scenario.