POST
|
Hi Joe, Thanks for your help on this. I ended up creating a new prototype project to narrow down the code as I could not get the sync to work even with removing one or the other calls in my application. In my prototype, I used Job.Start() while monitoring the job and removed Job.GetResultAsync(). The prototype project worked fine. I appreciate your help in understanding these two approaches. Thanks again! Jen
... View more
09-05-2019
09:47 AM
|
0
|
0
|
828
|
POST
|
Hello, I am using ArcGIS Runtime for .NET 100.5, and attempting to sync a .geodatabase replica to a hosted feature layer in ArcGIS Online. I am getting an error that states 'unable to synchronize replica'. When I look at the error details, the message is 'Importing delta data changes failed'. To create the hosted feature layer, I created a Map in ArcGIS Pro with 30 point, line and polygon feature layers, and then used the tools to Share the map to an ArcGIS Online organizational account. I set the web map to be 'offline enabled', and I also enabled the 'Sync' option on the Hosted Feature Layer. I was able to create the offline .geodatabase file with just a few lines of code thanks to the sample code provided by ESRI (see below), and I also used sample code to attempt to sync the replica (see below). I'm not sure how to troubleshoot this issue as there is little information provided in the error message. Has anyone else had a problem with this particular error, or have suggestions as to how to track more info about the error down? Thanks! Jen Creating the replica SpatialReference sp = new SpatialReference(3857); //Web mercator wkid // Get the extent of the current map //Envelope extent = mainMap.InitialViewpoint.TargetGeometry.Extent as Envelope; Envelope extent = new Envelope(-9972280.458, 6146072.133, -9907308.984, 6193615.965, sp); // Create a task for generating a geodatabase (GeodatabaseSyncTask). _gdbSyncTask = await GeodatabaseSyncTask.CreateAsync(_featureServiceUri); // Get the default parameters for the generate geodatabase task. GenerateGeodatabaseParameters generateParams = await _gdbSyncTask.CreateDefaultGenerateGeodatabaseParametersAsync(extent); // Create a generate geodatabase job. GenerateGeodatabaseJob generateGdbJob = _gdbSyncTask.GenerateGeodatabase(generateParams, _gdbPath); // Start the job. generateGdbJob.Start(); // Get the result of the job. _resultGdb = await generateGdbJob.GetResultAsync(); Syncing the replica with the server Geodatabase resultGdb = await Esri.ArcGISRuntime.Data.Geodatabase.OpenAsync(_gdbPath); // Create parameters for the sync task. SyncGeodatabaseParameters parameters = new SyncGeodatabaseParameters() { GeodatabaseSyncDirection = SyncDirection.Bidirectional, RollbackOnFailure = false }; parameters.LayerOptions.Clear(); // Get the layer ID for each feature table in the geodatabase, then add to the sync job. foreach (GeodatabaseFeatureTable table in resultGdb.GeodatabaseFeatureTables) { // Get the ID for the layer. long id = table.ServiceLayerId; // Create the SyncLayerOption. SyncLayerOption option = new SyncLayerOption(id); // Add the option. parameters.LayerOptions.Add(option); } // Create job. SyncGeodatabaseJob job = _gdbSyncTask.SyncGeodatabase(parameters, resultGdb); job.Start(); // Wait for the result. await job.GetResultAsync(); // Do the remainder of the work. HandleSyncCompleted(job);
... View more
08-07-2019
01:39 PM
|
0
|
2
|
1080
|
POST
|
Eight months later I saw your post . Not sure how I missed it. Glad this was a successful approach for you. Jen
... View more
08-05-2019
07:00 AM
|
0
|
0
|
1000
|
POST
|
You're right! That definitely answered my question. Thanks! Jen
... View more
07-12-2019
01:11 PM
|
0
|
1
|
1225
|
POST
|
Hi Joe, Just after I sent my last response I added another line of code to get the ArcGISFeature and that worked! Thanks for your reply, it essentially fixed my issue! foreach (Feature feat in queryResult) { ArcGISFeature arcFeat = feat as ArcGISFeature; await arcFeat.LoadAsync(); ... Jen
... View more
07-12-2019
12:13 PM
|
0
|
3
|
1225
|
POST
|
Hi Joe, Thanks for your quick response! I was trying the addition of 'LoadAsync' on the feature today but I am still not getting all of the attributes. You are right that I am using an online feature service. When I look at the properties of the FeatureTable both before and after running LoadAsync() I do have all 10 fields but the attributes still include only 4 key,value pairs. Have I missed something here? Thanks! Jen LayerCollection lyrColl = Map.OperationalLayers; Layer lyr = lyrColl[0]; FeatureLayer flayer = lyr as FeatureLayer; FeatureQueryResult queryResult = await flayer.GetSelectedFeaturesAsync(); foreach (Feature feat in queryResult) { await feat.FeatureTable.LoadAsync(); ...and so on... }
... View more
07-12-2019
12:03 PM
|
0
|
0
|
1225
|
POST
|
Hello, I am attempting to search the Attributes property of a Feature to find a specific field name. FeatureLayer flayer = lyr as FeatureLayer; FeatureQueryResult queryResult = await flayer.GetSelectedFeaturesAsync(); foreach (Feature feat in queryResult) { var catAtt = feat.Attributes.Where(x=>x.Key == "Category"); } Although my FeatureLayer has 6 editable fields, I find that only 5 attributes are listed within the Attributes property. When I look for 'Category', the search does not return anything although I know the field exists. Is there something that I need to set up on the layer to return all of the Attributes when using the GetSelectedFeaturesAsync() method? Thanks! Jen
... View more
07-11-2019
10:22 AM
|
0
|
6
|
1536
|
POST
|
Hi Joe, Thanks for your insight and code snippet! I am looking at MVVM Light as it seems like it may be simpler to me to follow as someone new to these frameworks. I've started an intro course on Pluralsight so I'll see how it goes. Thanks again for your help.
... View more
03-05-2019
12:11 PM
|
0
|
0
|
2709
|
POST
|
Hi Morton, Thanks for your feedback on this. Currently, I'm looking into the MVVM Light framework to use with my application. It seems Pluralsight has a good intro provided by Laurent Bugnion. I managed to bind the button click without the use of any framework but I think using an existing one will be important as I move forward with this application. I do like your suggestion of putting view specific code in the code-behind, and then forwarding the event on to the viewmodel for simplification purposes. Although I want to adhere to the MVVM pattern, I am not opposed to this approach if it makes things easier to follow.
... View more
03-05-2019
12:08 PM
|
0
|
0
|
2709
|
POST
|
Hello, I am trying to create binding for the GeoViewTappedAsync event so that I can place the code in my MapViewModel to follow an MVVM pattern for my WPF application, however I'm not sure how to wire this up. Is there some sample code available that demonstrates this pattern? After looking through GeoNet, I have found some suggestions but they are a few years old. <esri:MapView x:Name="MainMap" Map="{Binding Map}" GeoViewTapped="Binding {to what does this bind?}"> Thank you! Jen
... View more
03-04-2019
08:30 AM
|
0
|
13
|
4533
|
POST
|
Hi Morten, Thanks for your insight. I see your point about the difference between mobile and desktop views. We are still in the discovery phase in determining all of the features of the application but it appears that most are desktop oriented at this point. It is interesting to hear that Windows 7 is on its way out so if we do decide to support a UWP version, an older OS might not be something to fear. Regards! Jen
... View more
02-07-2019
06:46 AM
|
0
|
0
|
606
|
POST
|
Hello, I came across an article that states that Xamarin Forms now has support for WPF in addition to iOS, Android and UWP. WPF Platform Setup - Xamarin | Microsoft Docs Is this on the road map for the ArcGIS Runtime SDK for .NET? I would like to use UWP however, many of the clients I am creating an app for do not have machines with Windows 10, and so it is probably wiser to develop using WPF. At the same time, I was hoping to be able to expand support for iOS and Android after developing the WPF app. Thanks, Jen
... View more
02-06-2019
01:09 PM
|
0
|
2
|
1576
|
POST
|
Hi Erwin, That is exactly what I was looking for. Thanks for your help! Jen
... View more
02-05-2019
07:24 AM
|
0
|
0
|
512
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|