Added Pathfinding Time
Renamed GetRoute -> GetRouteTime and GetRouteDistance
This commit is contained in:
parent
feb9b70e50
commit
8bd0c5a4d4
@ -15,7 +15,7 @@ var app = builder.Build();
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
app.MapGet("/getRoute", (float latStart, float lonStart, float latEnd, float lonEnd) =>
|
app.MapGet("/getRouteDistance", (float latStart, float lonStart, float latEnd, float lonEnd) =>
|
||||||
{
|
{
|
||||||
DateTime startCalc = DateTime.Now;
|
DateTime startCalc = DateTime.Now;
|
||||||
List<PathNode> result = Pathfinder.AStarDistance("D:/stuttgart-regbez-latest", new Coordinates(latStart, lonStart), new Coordinates(latEnd, lonEnd));
|
List<PathNode> result = Pathfinder.AStarDistance("D:/stuttgart-regbez-latest", new Coordinates(latStart, lonStart), new Coordinates(latEnd, lonEnd));
|
||||||
@ -24,6 +24,15 @@ app.MapGet("/getRoute", (float latStart, float lonStart, float latEnd, float lon
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
app.MapGet("/getRouteTime", (float latStart, float lonStart, float latEnd, float lonEnd) =>
|
||||||
|
{
|
||||||
|
DateTime startCalc = DateTime.Now;
|
||||||
|
List<PathNode> result = Pathfinder.AStarTime("D:/stuttgart-regbez-latest", new Coordinates(latStart, lonStart), new Coordinates(latEnd, lonEnd), Tag.SpeedType.car);
|
||||||
|
PathResult pathResult = new PathResult(DateTime.Now - startCalc, result);
|
||||||
|
return pathResult;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
app.MapGet("/getClosestNode", (float lat, float lon) =>
|
app.MapGet("/getClosestNode", (float lat, float lon) =>
|
||||||
{
|
{
|
||||||
RegionManager regionManager = new RegionManager("D:/stuttgart-regbez-latest");
|
RegionManager regionManager = new RegionManager("D:/stuttgart-regbez-latest");
|
||||||
|
Reference in New Issue
Block a user