예제 #1
0
파일: ORS.cs 프로젝트: rowanclarke/nea
        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);
        }
예제 #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);
        }