This commit is contained in:
glax 2023-04-01 18:10:26 +02:00
parent 4600105b0b
commit 2c5ab070a2

View File

@ -18,19 +18,15 @@ public class Server
Console.WriteLine("Loaded"); Console.WriteLine("Loaded");
Coordinates start = new Coordinates(48.7933989f, 9.8301467f); Coordinates start = new Coordinates(48.793319f, 9.832102f);
Coordinates finish = new Coordinates(48.7906258f, 9.8355983f); Coordinates finish = new Coordinates(48.840728f, 10.067603f);
OsmNode[] path = Pathfinder.CustomAStar("D:/map", start, finish, Tag.SpeedType.pedestrian).ToArray(); DateTime startTime = DateTime.Now;
Console.WriteLine("{0}\n", path[0].ToString()); OsmNode[] path = Pathfinder.CustomAStar("D:/stuttgart-regbez-latest", start, finish, Tag.SpeedType.car).ToArray();
TimeSpan duration = DateTime.Now - startTime;
Console.WriteLine($"Took {duration.TotalMilliseconds}ms ({duration:g})");
for (int i = 0; i < path.Length - 1; i++) for (int i = 0; i < path.Length - 1; i++)
{ {
OsmNode n1 = path[i]; Console.WriteLine(path[i]);
OsmNode n2 = path[i + 1];
OsmEdge? e = n1.GetEdgeToNode(n2);
if(e != null)
Console.WriteLine("{0}\n{1}", e.ToString(), n2.ToString());
else
Console.WriteLine("NO EDGE\n{0}", n2.ToString());
} }
Console.WriteLine(); Console.WriteLine();
} }