POST
|
Hi, I had attached my test code here, but I won't be able to provide the network dataset used. Also, I had observed that my RouteResult.Routes[0].GetTotalLength(LinearUnits.Meter) is always 0 - might that be the problem to the scaled barrier computation? Thanks, Lina
... View more
07-27-2015
01:05 AM
|
0
|
0
|
754
|
POST
|
Hi, I am using ArcGIS Runtime for .NET, 10.2.6, and using LocalRouteTask to execute routing analysis. I would like to indicate some scaled-cost polygon barriers for routing. I had created a set of polygon barriers to be added to the route analysis, and then added the following attributes: - polygonGraphic.Attributes[BarrierType] = 1; Adding this line do allow me to route across the polygon barriers. Then, to consider the scaled cost, I had tried adding the following attributes (my impedance attribute is "Length"): - polygonGraphic.Attributes["Attr_Length"] = 2; - polygonGraphic.Attributes["Length"] = 2; The returned result, do show a route across the barrier, but I am not sure if the cost were actually considered. Checking the attributes of the polygonbarriers: - RouteResult.PolygonBarriers[index].Attributes["AddedCost"] : always an empty dictionary - RouteResult.PolygonBarriers[index].Attributes["Status"] : always 0 - RouteResult.PolygonBarriers[index].Attributes["BarrierType"] : value=1. Any advice? Thanks in advance.
... View more
07-22-2015
12:44 AM
|
1
|
5
|
3926
|
POST
|
Hi, right now I am using 10.2.6 to test... The code segment below (ORIGINAL) also produces the AccessViolationException with 10.2.6 occasionally. Note if the Exception do not happen on the first run, restart application again. I seem to get this exception 1 out of 5 times. I made some slight changes to the original code, and AccessViolationException seems to be eliminated. I have not done rigorous testing yet to ensure that this behave safely...: Changes (See UPDATED code segment below): - Remove LocalRouteTask instance creation in Parallel() method. - Create LocalRouteTask instance in the SolveAsync() method, and then use that instance to solve route problem. This somehow seems eliminates the AccessViolationException. NetworkAnalystException is still thrown sometimes on the first run, with message "Cannot solve". I am guessing that in the original code segment, LocalRouteTask was created in another thread (eg. ThreadID = 10), and then was used to solve routing problem in other threads (eg. ThreadID=15 and ThreadID=16) which might cause the Exception to happen(?). Just my guess - would be nice to know exactly why AccessViolationException happens. The following will also cause the AccessViolationException to occur. Don't really suppose it is thread issue... void Parallel() { ... LocalRouteTask task1 = new LocalRouteTask(Constants.NetworkDB); RouteParameters param1 = await GetParam(...); LocalRouteTask task2 = new LocalRouteTask(Constants.NetworkDB); RouteParameters param2 = await GetParam(...); ... for (int i = 0; i < 5; i++) { Task t1 = task1.SolveAsync(param1); Task t2 = task2.SolveAsync(param2); await t1; await t2; } ... } ORIGINAL--- private async Task<RouteParameters> GetParam(LocalRouteTask task, string dirStyle, bool includeBarrier) { RouteParameters routeParams = await task.GetDefaultParametersAsync(); routeParams.FindBestSequence = false; routeParams.PreserveFirstStop = false; routeParams.PreserveLastStop = false; routeParams.OutputLines = OutputLine.TrueShapeWithMeasure; routeParams.DirectionsLengthUnit = LinearUnits.Meters; routeParams.DirectionsStyleName = dirStyle; routeParams.DirectionsLanguage = new CultureInfo("en-US"); ; routeParams.ReturnStops = true; routeParams.ReturnRoutes = true; routeParams.ReturnDirections = true; routeParams.ReturnPointBarriers = true; routeParams.ReturnPolygonBarriers = true; routeParams.ReturnPolylineBarriers = true; routeParams.IgnoreInvalidLocations = false; return routeParams; } private async void Parallel(object sender, RoutedEventArgs e) { try { MapPoint mp0 = new MapPoint(11541840.7711455, 146578.730235322, SpatialReference.Create(102100)); MapPoint mp1 = new MapPoint(11570869.2480698, 146689.314909319, SpatialReference.Create(102100)); List<Graphic> stops = new List<Graphic>() { new Graphic(mp0), new Graphic(mp1) }; LocalRouteTask task1 = new LocalRouteTask(Constants.NetworkDB); RouteParameters param1 = await GetParam(task1, Constants.NADesktop, false); param1.SetStops(stops); LocalRouteTask task2 = new LocalRouteTask(Constants.NetworkDB); RouteParameters param2 = await GetParam(task2, Constants.NADesktop, false); param2.SetStops(stops); Stopwatch stopwatch = new Stopwatch(); stopwatch.Start(); for (int i = 0; i < 5; i++) { Task t1 = Task.Run(async () => { await SolveRouteAsync(1, stopwatch, task1, param1); }); Task t2 = Task.Run(async () => { await SolveRouteAsync(2, stopwatch, task2, param2); }); await t1; await t2; } //stopwatch.Stop(); Console.WriteLine("Parallel timing: " + stopwatch.ElapsedMilliseconds); task1.Dispose(); task2.Dispose(); } catch (AggregateException ex) { Console.WriteLine(ex.ToString()); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } } private async Task SolveRouteAsync(int id, Stopwatch stopwatch, LocalRouteTask task, RouteParameters param) { Console.WriteLine("elapsed run {0}: {1} ", id, stopwatch.ElapsedMilliseconds); RouteResult t1 = await task.SolveAsync(param).ConfigureAwait(false); } ORIGINAL END--- UPDATED--- private async void Parallel(object sender, RoutedEventArgs e) { try { MapPoint mp0 = new MapPoint(11541840.7711455, 146578.730235322, SpatialReference.Create(102100)); MapPoint mp1 = new MapPoint(11570869.2480698, 146689.314909319, SpatialReference.Create(102100)); List<Graphic> stops = new List<Graphic>() { new Graphic(mp0), new Graphic(mp1) }; Stopwatch stopwatch = new Stopwatch(); stopwatch.Start(); for (int i = 0; i < 5; i++) { Task t1 = Task.Run(async () => { await SolveRouteAsync(1, stopwatch, stops); }); Task t2 = Task.Run(async () => { await SolveRouteAsync(2, stopwatch, stops); }); await t1; await t2; } //stopwatch.Stop(); Console.WriteLine("Parallel timing: " + stopwatch.ElapsedMilliseconds); } catch (AggregateException ex) { Console.WriteLine(ex.ToString()); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } } private async Task SolveRouteAsync(int id, Stopwatch stopwatch, List<Graphic> stops) { LocalRouteTask task = new LocalRouteTask(Constants.NetworkDB); RouteParameters param = await GetParam(task, Constants.NADesktop, false); param.SetStops(stops); Console.WriteLine("elapsed run {0}: {1} ", id, stopwatch.ElapsedMilliseconds); RouteResult t1 = await task.SolveAsync(param).ConfigureAwait(false); task.Dispose(); }
... View more
07-19-2015
11:53 PM
|
0
|
0
|
408
|
POST
|
I am using ArcGIS Runtime .NET 10.2.5, and investigating the behaviour of running multiple analysis on different LocalRouteTask instances. However, either following behaviour will occur frequently: - exception "AccessViolationException" was thrown (based on the code below) and will kill my test application - NetworkAnalystException was thrown but could be caught. Subsequent execution on route analysis has no issue. Note: the following codes were just for reference, as it is supposed to measure time taken to complete 2 analysis on different LocalRouteTask instances. After line X was executed, then then above behaviours will occur. I am speculating that if more than one LocalRouteTask references the same .geodatabase, and calling SolveAsync() on both tasks simultaneously will cause some issues like above? ... public async void ButtonClick(object sender, EventArgs e) { LocalRouteTask routeTask1 = new LocalRouteTask(Constants.NetworkDB); RouteParameters param1 = await routeTask1.GetDefaultTaskParameters(); LocalRouteTask routeTask2 = new LocalRouteTask(Constants.NetworkDB); RouteParameters param2 = await routeTask2.GetDefaultTaskParameters(); Task t1 = Task.Run(()=> SolveRoute(routeTask1, param1); Task t2 = Task.Run(()=> SolveRoute(routeTask2, param2); // line X await t1; await t2; } public async Task SolveRoute(LocalRouteTask task, RouteParameters param) { await task.SolveAsync(param); }
... View more
07-12-2015
11:29 PM
|
0
|
3
|
3247
|
POST
|
Hi, I am using LocalRouteTask on ArcGIS Runtime SDK for .NET, 10.2.5. Following are some questions about the RoutingParameters and Results 1) routingParameters.ReturnRoutes: Based on the documentation, directions should still be returned if this parameter was set to false. Based on my observation - no routes were ever returned if this property were set to false. Ie. RouteResult.Routes.Count() == 0, so there is no way to even retrieve the directions. Is this a bug? 2) routingParameters.IgnoreInvalidLocations: I am assuming the following behaviour if I had set this property to true...: Define Stops A, B, and C. A route is possible between stops A and B, while there is no possible route for any combination involving stop C. So setting this property to True should find me a route between stops A and B. Based on observation, no routes was returned if I had submitted the 3 stops together. Not even with FindBestSequence=true. Is this a bug? 3) Returned result: RouteDirection.Event, DirectionsEvent class. Not quite sure what kind of data DirectionsEvent contains, as my network routing analysis does not return any data for this property, would like to be enlighten on this property and class. Thanks in advance!
... View more
05-13-2015
02:54 AM
|
0
|
0
|
3546
|
POST
|
Hi Asser, Thanks for the reply. I am actually interested in "how" the cost value is being represented/provided through the runtime API. Ie. taking a look at ArcGIS Desktop, Route Properties section, is it safe to assume that Total_[ImpedanceAttribute] will be included in Runtime API: Route.TotalCost dictionary? -Based on my observation, with the only impedance attribute (Length) I have, Route.TotalCost[Total_Length] is never provided along with any of the Route object. -So then, I tried this: routeParameters.AccumulateAttributeNames.Add("Length") - which then throws an internal error when attempting to solve for the network routing So will Route.TotalCost property actually be providing accumulated cost based on the impedance attribute? Am I missing any configuration? Thanks in advance!
... View more
05-10-2015
08:22 PM
|
0
|
0
|
288
|
POST
|
I am using LocalRouteTask, on ArcGIS Runtime SDK for .NET 10.2.5 I have a limited network dataset (the only impedance is Length), so I have not been able to make an observation on the following. In any circumstances that the LocalRouteTask returns more than one Route in RouteResult, how are these routes ordered? Are they ordered by the cost (on the impedance attribute)? Would like to know what does the property Route.TotalCost indicate? What is specified as "key". The routes I had solved only provides: - TotalWait_Length (always 0) - TotalViolation_Length (always 0) I am assuming that Route.TotalCost to include the cost based on impedance attribute. Eg. ImpedanceAttribute = "Slope" So...Route.TotalCost["Slope"] will return the cost of the route
... View more
05-07-2015
06:33 PM
|
0
|
2
|
3769
|
POST
|
I am exploring LocalRouteTask, using ArcGIS Runtime SDK for .NET 10.2.5. I would like to know when, and under what kind of circumstances, will the returned result (RouteResult) contain more than 1 Route? Just curious if this case will ever be reached. Thanks in advance!
... View more
04-26-2015
08:27 PM
|
0
|
1
|
3267
|
POST
|
Hi I would like to benchmark time taken to render a Graphic object onto the map. We are using ArcGIS Runtime for .NET, while using WPF to build the application. Would like to know if ArcGIS Runtime do provide any API that we can guarantee that the layer/map had finished rendering (ie. the new Graphic must be visible on the map)? Thanks in advance!
... View more
04-16-2015
11:04 PM
|
0
|
1
|
3476
|
POST
|
I am using ArcGIS Runtime for .NET 10.2.4, and doing LocalRouteTask with a .geodatabase file. Geodatabase file, cost attribute is Length (Meters) I was testing the behaviour for RouteParameters.OutputLine which seems a little different from expectation based on the documentation Basic Config: RouteParameters routeParam = await routeTask.GetDefaultParametersAsync(); routeParam.OutSpatialReference = MapView.SpatialReference; routeParam.ReturnRoute = true; routeParam.ReturnDirections = true; routeParam.DirectionLengthUnits = LinearUnits.Kilometers; routeParam.DirectionLanguage = new CultureInfo("en-US"); routeParam.SetStops(stops); routeParam.ReturnStops = true; routeParam.ImpedanceAttributeName = "Length"; Varying Setting: routeParam.OutputLine = Default Observation: RouteResult is always null. routeParam.OutputLine = Straight Observation: RouteResult returns a route, but returns empty Geometry (a Polyline with 0 parts) routeParam.OutputLine = TrueShape Observation: RouteResult returns a route, with a Polyline geometry. Polyline geometry contains M values routeParam.OutputLine = TrueShapeWithMeasure Observation: RouteResult returns a route, with a Polyline geometry. Polyline geometry contains M values. My confusion here is: - Does OutputLine.Default not solve for routing? - OutputLine.Straight was suppose to return straight lines between stops, but the observation shows an empty geometry - OutputLine.TrueShape and TrueShapeWithMeasure shows the same result (both has M values), should that be the case? Further testing: routeParam.OutputLine = TrueShapeWithMeasure routeParameter.OutputGeometryPrecision = 0 / 10 / 1000; routeParameter.OutputGeometryPrecisionUnit = LinearUnits.Meters The above configuration returns the same geometry result for different OutGeometryPrecision values. I was expecting higher precision values to lower the number of points/line segments in the returned Geometry. Should that be the case? Thanks in advance!
... View more
03-31-2015
11:50 PM
|
0
|
1
|
3894
|
POST
|
Oh yes, I was looking for the HTTP debugging traffic - the LocalServerUtility works for me. Thanks!
... View more
03-25-2015
06:30 PM
|
0
|
0
|
312
|
POST
|
I am following the instructions here Create an ArcGIS Runtime deployment—ArcGIS Runtime SDK for .NET | ArcGIS for Developers, using the 2nd option - creating runtime deployment without the manifest. How can I create the deployment folder such that it supports debugging / no-debugging?
... View more
03-24-2015
10:37 PM
|
0
|
2
|
4186
|
POST
|
During creation of a workflow model and then exporting as GPK for runtime use in ArcGIS for Desktop: - Task name, input and output parameters has no limitation as to what kind of characters can be used. However when running a local geoprocessing service from the GPK, it was observed that: - input and output parameters: non-alphanumeric characters were escaped as underscores "_" - task URL - non-alphanumeric characters were escaped as ASCII characters (?). However, when testing the possibility of weird task names, it seemed that, in certain cases, these task URL cannot be accessed no matter how they were escaped. eg: the task URL = "bb,.@#$%^&*()-+aa" I had worked through most combination of URL encoding to find that...only / cannot be encoded - thus a task URL with / characters cannot be accessed. Is that a restriction on the ArcGIS Local Server? Is there a guideline as to how ArcGIS deal with geoprocessing tasks URL with non-alphanumeric alphabets, or does ArcGIS Runtime has any helper class/method to handle these cases. I am using ArcGIS Runtime SDK for .Net 10.2.4, and thanks in advance. Message was edited by: Lina Yap
... View more
02-25-2015
09:29 PM
|
0
|
0
|
3783
|
POST
|
Using ArcGISRuntime SDK for .NET - the issue here is that the mapview event, MapViewHolding, can't seem to be triggered by mouse. It works for touch. There is no issue with other MapView events (doubletapped/tapped) Might this be a bug?
... View more
11-27-2014
05:24 PM
|
0
|
1
|
2276
|
POST
|
Hi Antti, I had not received your mail. I will mail you another address. Thanks. Lina
... View more
11-17-2014
09:34 PM
|
0
|
0
|
468
|
Title | Kudos | Posted |
---|---|---|
1 | 07-22-2015 12:44 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|