33 lines
1.1 KiB
C#
33 lines
1.1 KiB
C#
using OSMDatastructure;
|
|
using OSMDatastructure.Graph;
|
|
using Pathfinding;
|
|
|
|
namespace Server;
|
|
|
|
public class Server
|
|
{
|
|
|
|
public static void Main(string[] args)
|
|
{
|
|
ConsoleWriter newConsole = new ConsoleWriter();
|
|
Console.SetOut(newConsole);
|
|
Console.SetError(newConsole);
|
|
|
|
//RegionConverter.ConvertXMLToRegions("D:/stuttgart-regbez-latest.osm", "D:/stuttgart-regbez-latest");
|
|
//RegionConverter.ConvertXMLToRegions("D:/map.osm", "D:/map");
|
|
Console.WriteLine("Loaded");
|
|
|
|
|
|
Coordinates start = new Coordinates(48.793319f, 9.832102f);
|
|
Coordinates finish = new Coordinates(48.840728f, 10.067603f);
|
|
DateTime startTime = DateTime.Now;
|
|
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++)
|
|
{
|
|
Console.WriteLine(path[i]);
|
|
}
|
|
Console.WriteLine();
|
|
}
|
|
} |