Exemplo n.º 1
0
        public static async Task <DirectionResponse> GetGeometry(Core.Route route)
        {
            string responseString = await UseORS("/v2/directions/driving-car/geojson", $"{{\"coordinates\":{route.Locations()},\"instructions\":\"false\"}}");

            DirectionResponse responseData = JsonSerializer.Deserialize <DirectionResponse>(responseString);

            return(responseData);
        }
Exemplo n.º 2
0
        public Core.GeoRoute GetGeoRoute(Core.RoutePackage task)
        {
            RemoteWorker worker = new RemoteWorker();

            ORS.MatrixResponse matrixResponse = ORS.ORS.GetMatrix(task).Result;
            task.matrix = new Core.AdjacencyMatrix(matrixResponse.ToFloat());
            Core.Route route = worker.GetRouteSubgraph(task);

            ORS.DirectionResponse directionResponse = ORS.ORS.GetGeometry(route).Result;

            Core.GeoRoute geoRoute = new Core.GeoRoute(route, directionResponse.features[0].geometry.ToFloat());

            return(geoRoute);
        }