public void TestPredictedErrorsOnSimpleFlightRoute() { var input = new NavigationPredictionData <IVerifiable> (); var path = new SimpleFlightRouteData(); path.Start = new DateTimeOffset(2014, 5, 3, 0, 0, 0, 0, new TimeSpan(0)); path.Waypoints.Add(new ServiceCartographic2D(39.0, -104.77)); path.Waypoints.Add(new ServiceCartographic2D(30.0, -98.0)); path.Waypoints.Add(new ServiceCartographic2D(40.0, -77.0)); path.TurningRadius = 1000.0; path.Speed = 111.76; path.Altitude = 9144.0; path.MeanSeaLevel = true; input.Path = path; var result = NavigationServices.GetPredictedNavigationErrorsOnARoute(input).Result; Assert.That(result.Errors.Length > 0); }
/// <summary> /// Gets predicted Gps errors along a route /// </summary> /// <param name="predictionDataForRoute">Data for the prediction</param> /// <returns>RouteNavigationErrorResults</returns> public static async Task <RouteNavigationErrorResults> GetPredictedNavigationErrorsOnARoute( NavigationPredictionData <IVerifiable> predictionDataForRoute) { string relativeUri = string.Empty; predictionDataForRoute.Verify(); if (predictionDataForRoute.Path.GetType() == typeof(PointToPointRouteData)) { relativeUri = ServiceUris.NavigationPredictedPointToPointUri; } else if (predictionDataForRoute.Path.GetType() == typeof(SimpleFlightRouteData)) { relativeUri = ServiceUris.NavigationPredictedSimpleFlightUri; } else if (predictionDataForRoute.Path.GetType() == typeof(TolRouteData)) { relativeUri = ServiceUris.NavigationPredictedTolUri; } else if (predictionDataForRoute.Path.GetType() == typeof(RasterRouteData)) { relativeUri = ServiceUris.NavigationPredictedRasterUri; } else if (predictionDataForRoute.Path.GetType() == typeof(GreatArcRouteData)) { relativeUri = ServiceUris.NavigationPredictedGreatArcUri; } if (string.IsNullOrEmpty(relativeUri)) { throw new ArgumentOutOfRangeException("accessData", (Type)predictionDataForRoute.Path, (Type)predictionDataForRoute.Path + " is not a valid type for Navigation paths"); } var uri = Networking.GetFullUri(relativeUri); return(await Networking.HttpPostCall <NavigationPredictionData <IVerifiable>, RouteNavigationErrorResults>(uri, predictionDataForRoute)); }
public static async Task <SiteNavigationErrorResults> GetAssessedNavigationErrorsAtASite( NavigationPredictionData <IVerifiable> assessedDataForSite) { string relativeUri = string.Empty; assessedDataForSite.Verify(); if ((Type)assessedDataForSite.Path == typeof(SiteData)) { relativeUri = ServiceUris.NavigationAssessedSiteUri; } if (string.IsNullOrEmpty(relativeUri)) { throw new ArgumentOutOfRangeException("assessedDataForSite", (Type)assessedDataForSite.Path, (Type)assessedDataForSite.Path + " is not a valid type for Navigation paths"); } var uri = Networking.GetFullUri(relativeUri); return(await Networking.HttpPostCall <NavigationPredictionData <IVerifiable>, SiteNavigationErrorResults>(uri, assessedDataForSite)); }