Adjusted API to new Pathfinder calls.

This commit is contained in:
glax 2023-04-23 14:06:19 +02:00
parent 5b8a1d1e10
commit 6bc1d3c7ce

View File

@ -15,18 +15,18 @@ var app = builder.Build();
app.MapGet("/getRoute", (float latStart, float lonStart, float latEnd, float lonEnd, Tag.SpeedType vehicle, double stayOnSameRoadPriority, double useHigherLevelRoadsPriority, double useRoadsWithLessJunctionsPriority, double angleFactor) =>
{
Pathfinder result = new Pathfinder("D:/stuttgart-regbez-latest").AStar(new Coordinates(latStart, lonStart),
new Coordinates(latEnd, lonEnd), vehicle, useHigherLevelRoadsPriority, stayOnSameRoadPriority,
useRoadsWithLessJunctionsPriority, angleFactor);
Pathfinder result = new Pathfinder("D:/stuttgart-regbez-latest", useHigherLevelRoadsPriority, stayOnSameRoadPriority,
useRoadsWithLessJunctionsPriority, angleFactor).AStar(new Coordinates(latStart, lonStart),
new Coordinates(latEnd, lonEnd), vehicle);
return result.pathResult;
}
);
app.MapGet("/getShortestRoute", (float latStart, float lonStart, float latEnd, float lonEnd) =>
{
Pathfinder result = new Pathfinder("D:/stuttgart-regbez-latest").AStar(new Coordinates(latStart, lonStart),
new Coordinates(latEnd, lonEnd), Tag.SpeedType.any, 0, 0,
0, 0);
Pathfinder result = new Pathfinder("D:/stuttgart-regbez-latest", 0, 0,
0, 0).AStar(new Coordinates(latStart, lonStart),
new Coordinates(latEnd, lonEnd), Tag.SpeedType.any);
return result.pathResult;
}
);