|
POST
|
Question about how to use PopuateFromServiceAsync(). The documentation states: "Asynchronously performs manual query of data from the service and imports feature results into the table." Imports? If subsequent calls are made for the same data, is it overwritten/updated in the feature table, or will duplicates be created? In the example above, I'm thinking the ideal situation would be to not use 1=1 when calling this method to maximize performance. Offline is obviously a different pattern since all of the data is expected to be cached locally. But online, we'd want to minimize the amount of data transferred when requesting data from the service. Thanks again for your assistance.
... View more
04-05-2017
05:07 PM
|
0
|
2
|
2547
|
|
POST
|
Thanks, that would be helpful to understand. Your help is greatly appreciated, thanks so much!!
... View more
04-05-2017
03:43 PM
|
0
|
0
|
2547
|
|
POST
|
Jennifer, thanks again, your solution worked for me. I was using the wrong cache mode, and didn't realize to call PopulateFromServiceAsync(). Once I updated that, things worked out. I also did change the query to use the upper case of the GlobalId. I was wondering about this, but maybe a different thread. Using the original query (lowercase) works when executed through the REST API. And the resulting field does not seems to be stored in upper case.
... View more
04-05-2017
03:07 PM
|
0
|
5
|
2547
|
|
POST
|
Trying to wire up a basic table query, but not having much luck. The goal would be to add some initial support for relationships (I know it's coming soon), but we have folks asking for it now. To test/develop, we downloaded the manhole inspection template from the water data model and published it to AGOL. The only change made was to link based on GlobalId, rather than FacilityId. There is currently only one record, with a single related record. The related record was created using Collector (maybe that was the issue??). Everything works fine if you add the data to an AGOL web map, we can see the related record. The following code returns no records, although using the same query directly on the REST API returns the record. var destTable = new ServiceFeatureTable (new Uri (
"http://services6.arcgis.com/v1B7paWSaOfBIIVv/ArcGIS/rest/services/ManholeInspections/FeatureServer/1"
));
destTable.FeatureRequestMode = FeatureRequestMode.OnInteractionCache;
await destTable.LoadAsync ();
var query = "ManholeNumber = 'dd11f844-16b0-4e86-9fbd-ca77275dba0e'";
FeatureQueryResult queryResult = await destTable.QueryFeaturesAsync (new QueryParameters () {
WhereClause = query
}, QueryFeatureFields.LoadAll);
var ftrs = queryResult.ToList ();
if (ftrs.Any ()) {
//Handle the results
};
... View more
04-04-2017
06:07 PM
|
0
|
7
|
3446
|
|
POST
|
Excellent, that'll work for now. Hadn't realized you could use the query text for the organization. Thanks for the quick feedback, much appreciated.
... View more
03-21-2017
03:43 PM
|
0
|
0
|
4194
|
|
POST
|
Setting the CanSearchPublic flag for the PortalQueryParameters doesn't seem to have an impact on the results: var queryString = "type:(\"web map\" NOT \"web mapping application\")";
var portalQuery = new PortalQueryParameters (queryString);
portalQuery.CanSearchPublic = false;
var maps = await arcgisPortal.FindItemsAsync (portalQuery);
ToastHelpers.ShowInfo ("Web Maps", maps.TotalResultsCount.ToString (), 3);
... View more
03-19-2017
05:04 AM
|
0
|
2
|
5033
|
|
POST
|
We are using this to draw a solid line with throwing any errors. The polyline passed in is created using a List<MapPoint>, such as var polyline = new Polyline(mapPtList); Maybe there is an issue with the Geometry created by the polyline builder. /// <summary>
/// Creates the line symbol.
/// </summary>
/// <param name="polyline">Polyline.</param>
public static Graphic CreatePolylineSymbol (Polyline polyline)
{
//Create the symbol and add the graphic to the map
var lineSymbol = new SimpleLineSymbol () {
Width = 5,
Style = SimpleLineSymbolStyle.Solid
#if !__IOS__
#if WINDOWS_UWP
,Color = Windows.UI.Colors.Cyan
#else
,Color = System.Drawing.Color.Cyan
#endif
#endif
} ;
//Create the graphic and add to the map
Graphic lineGraphic = new Graphic (polyline, lineSymbol);
return lineGraphic;
}
... View more
03-17-2017
04:43 AM
|
0
|
2
|
1530
|
|
POST
|
Well, I'm not able to reproduce with your code when added to a button, however, it still happens in the code using the workflow of our app. So, appears not to be an issue with the API, but rather something in our app. Thanks for your help.
... View more
03-16-2017
07:52 AM
|
0
|
0
|
899
|
|
POST
|
Thanks for your reply. I have a method that looks like this, and it will terminate the app every time: public static async Task<Geodatabase> GenerateOfflineGdbAsync(string mapName, Envelope mapExtent)
{
//Create the task and get the default parameters
GeodatabaseSyncTask gdbSyncTask = null;
var url = "http://sampleserver6.arcgisonline.com/arcgis/rest/services/Notes/FeatureServer";
//TODO: This will crash the app if not a valid sync service....how to avoid??
try {
gdbSyncTask = await GeodatabaseSyncTask.CreateAsync (new Uri (url));
} catch (Exception ex) {
throw new Exception ("An error occurred while creating the sync task. Check the sync Url is correct and try again.\n\n" + ex.Message);
} There may be some other things at play here, for example, there is code in place before this to make sure the device doesn't enter sleep mode. I wouldn't think this would have an impact on this, but just wanted to throw it out there. I have the HockeyApp crash logs, but it doesn't seem to share much useful information. I can share that if you think it is worth it. I'll try tomorrow to grab more debug info from the device to see if I can more helpful information. I'll also try to pull out the code into a self contained example to see if the issue still happens and let you know. Thanks!
... View more
03-15-2017
05:24 PM
|
0
|
1
|
899
|
|
POST
|
Thanks, this is better. I appreciate your help. Now if only we could get more info rather than "Failed to create replica".....;-) Different topic, different thread, I know. We have worked through the previous issue, but are now stuck on the "Failed to create replica" error. Will post once we figure it out in case others encounter this. Once again, your help and responses are greatly appreciated.
... View more
03-15-2017
03:32 PM
|
0
|
0
|
2526
|
|
POST
|
This is helpful, I'll give it a shot. I assume that job.Messages is an accumulation of all of the messages? It fires the "Started" messages many times, so in theory, I could check if the status failed, and then inspect the last message? Also, after GetResultAsync, I was checking job.Error.Message, and this is null. I was sort of thinking if the job failed, then this would have some info. What is the intended use of the Error property on the job? Thanks for your help.
... View more
03-15-2017
02:38 PM
|
0
|
0
|
2526
|
|
POST
|
Using an invalid Url (misspelling or not sync enabled) will terminate the app (iOS, Android, UWP) without notice to the user. 1. Seems like there should be some protection so this doesn't terminate the app. It doesn't matter if CreateAsync is wrapped in a try/catch. 2. Is there a way to check the service prior to calling CreateAsync to check it is valid and sync enabled, other than downloading and inspecting the service definition? Thanks.
... View more
03-15-2017
12:16 PM
|
0
|
3
|
1771
|
|
POST
|
I've confirmed this error also happens when using the CreateReplica REST API, so definitely not related to the SDK, but if anyone has ever encountered this or has ideas, please share.
... View more
03-14-2017
02:55 AM
|
0
|
0
|
2526
|
|
POST
|
Getting the error below from the server logs. GenerateGeodatabaseJob.JobChanged returns a status = "Failed". GenerateGeodatabaseJob.Error.Message is null. Code worked fine until a new service was published with some additional layers. Quick check on the layers, everything appears fine, other than 2 have quite a large extent (some points where created at 0,0). Could this be causing the issue? We are working to resolve the extent issue, but wondering if there are any other ideas on paths to take to track down the culprit? <Msg time='2017-03-13T15:42:24,395' type='SEVERE' code='20010' target='System/SyncTools.GPServer' methodName='GPServerSync.CheckMessages' machine='LAB-GISTEST.BLAH.COM' process='9096' thread='6876' user='cd36ded5-d290-47e1-8875-8766e6d17998' >Error executing tool. CreateFeatureServiceReplica Job ID: j46b13418aa2e4e8093a15586e6ea3867 : ErrorMsg@SyncGPService:{"code":400,"description":"Error while writing layer info in SqLite geodatabase."} Failed to execute (Create Feature Service Replica).</Msg> Code: //Generate the Gdb and create the callback handler Job<Geodatabase> gdbJob = gdbSyncTask.GenerateGeodatabase (gdbParameters, gdbPath); gdbJob.JobChanged += (object sender, EventArgs evt) => #if WINDOWS_UWP Debug.WriteLine("[GDB GENERATE STATUS MESSAGE] " + gdbJob.Status.ToString()); #else Console.WriteLine("[GDB GENERATE STATUS MESSAGE] " + gdbJob.Status.ToString()); #endif }; //Get the result Geodatabase gdb = null; try { //Check for failed, and protect against a corrupt Gdb if (gdbJob.Status.ToString().Trim().ToLower() != "failed") gdb = await gdbJob.GetResultAsync (); } catch { } //Check the result if (gdb == null) { ToastHelpers.ShowError("Download Error", "Unable to download the selected feature data.\n\nError: " + gdbJob.Error.Message, 7); } else { ToastHelpers.ShowSuccess("Map Data Download", "Successfully downloaded the map data for offline use.", 5); }
... View more
03-13-2017
02:14 PM
|
0
|
9
|
5577
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 09-20-2017 11:09 AM | |
| 1 | 09-22-2017 10:32 AM | |
| 1 | 06-20-2017 07:32 AM | |
| 1 | 04-07-2017 03:32 AM | |
| 3 | 12-19-2019 12:58 PM |
| Online Status |
Offline
|
| Date Last Visited |
03-11-2025
09:48 AM
|