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!