OSMServer/Server/Server.cs
glax 619cad61ee Adjusted to new Functions and return values.
Now renders complete result with path and all loaded regions.
2023-04-19 22:55:49 +02:00

35 lines
1.2 KiB
C#

using System.Drawing;
using OSMDatastructure;
using OSMDatastructure.Graph;
using Pathfinding;
using RenderPath;
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");
//RegionConverter.ConvertXMLToRegions("D:/germany-latest.osm", "D:/germany-latest");
Coordinates start = new Coordinates(48.7933798f, 9.8275859f);
Coordinates finish = new Coordinates(48.795918f, 9.021618f);
PathResult result = Pathfinder.AStar("D:/stuttgart-regbez-latest", start,
finish, Tag.SpeedType.car, 0.01, 0.0001,
0);
Console.WriteLine("Drawing area");
ValueTuple<Image, Renderer.Bounds> area = Renderer.DrawArea(result.regionManager);
Console.WriteLine("Drawing route");
Renderer.DrawGraph(result.name, area.Item1, area.Item2);
}
}