Adjusted to new Functions and return values.

Now renders complete result with path and all loaded regions.
This commit is contained in:
glax 2023-04-19 22:55:49 +02:00
parent bfb117164e
commit 619cad61ee
2 changed files with 10 additions and 4 deletions

View File

@ -1,3 +1,4 @@
using System.Drawing;
using OSMDatastructure;
using OSMDatastructure.Graph;
using Pathfinding;
@ -19,12 +20,16 @@ public class Server
//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);
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.1, 0.2,
finish, Tag.SpeedType.car, 0.01, 0.0001,
0);
Console.WriteLine("Drawing area");
ValueTuple<Image, Renderer.Bounds> area = Renderer.DrawArea(result.regionManager);
Renderer.DrawGraph(result.name);
Console.WriteLine("Drawing route");
Renderer.DrawGraph(result.name, area.Item1, area.Item2);
}
}

View File

@ -13,6 +13,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="System.Drawing.Common" Version="7.0.0" />
<PackageReference Include="System.Runtime.Serialization.Json" Version="4.3.0" />
</ItemGroup>