OSMServer/Server/Server.cs

35 lines
1.2 KiB
C#
Raw Normal View History

using System.Drawing;
2023-04-01 01:00:22 +02:00
using OSMDatastructure;
using OSMDatastructure.Graph;
2023-04-01 14:43:22 +02:00
using Pathfinding;
using RenderPath;
2023-04-01 01:00:22 +02:00
2023-02-02 22:30:43 +01:00
namespace Server;
2023-02-02 19:03:00 +01:00
public class Server
{
2023-02-08 19:09:54 +01:00
2023-02-02 22:30:43 +01:00
public static void Main(string[] args)
2023-02-02 19:03:00 +01:00
{
ConsoleWriter newConsole = new ConsoleWriter();
Console.SetOut(newConsole);
Console.SetError(newConsole);
2023-04-13 00:24:33 +02:00
//RegionConverter.ConvertXMLToRegions("D:/stuttgart-regbez-latest.osm", "D:/stuttgart-regbez-latest");
2023-04-01 14:43:22 +02:00
//RegionConverter.ConvertXMLToRegions("D:/map.osm", "D:/map");
2023-04-06 14:46:19 +02:00
//RegionConverter.ConvertXMLToRegions("D:/germany-latest.osm", "D:/germany-latest");
2023-04-13 00:24:33 +02:00
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,
2023-04-13 00:24:33 +02:00
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);
2023-02-02 19:03:00 +01:00
}
}