Render result to png after every routing

This commit is contained in:
2023-04-13 01:00:56 +02:00
parent 367e9cfde0
commit 08e3da6fe3
5 changed files with 61 additions and 20 deletions

View File

@ -1,5 +1,6 @@
using OSMDatastructure;
using OSMDatastructure.Graph;
using RenderPath;
using static OSMDatastructure.Tag;
using WayType = OSMDatastructure.Tag.WayType;
@ -28,7 +29,14 @@ public static class Pathfinder
{
OsmNode currentNode = openSetfScore.Dequeue();
if (currentNode.Equals(goalNode))
return GetPath(cameFromDict, goalNode, regionManager);
{
List<PathNode> path = GetPath(cameFromDict, goalNode, regionManager);
List<Coordinates> coords = new();
foreach(PathNode pn in path)
coords.Add(pn.coordinates);
Renderer.DrawLoadedNodes(gScore, coords, workingDir);
return path;
}
foreach (OsmEdge edge in currentNode.edges)
{

View File

@ -8,6 +8,7 @@
<ItemGroup>
<ProjectReference Include="..\OSMDatastructure\OSMDatastructure.csproj" />
<ProjectReference Include="..\RenderPath\RenderPath.csproj" />
</ItemGroup>
</Project>