Datastructure rewrite

This commit is contained in:
2023-02-06 17:32:55 +01:00
parent 2c18162398
commit e265c56bce
19 changed files with 567 additions and 658 deletions

View File

@ -1,31 +1,14 @@
using OSMImporter;
using OSMDatastructure;
using Pathfinding;
namespace Server;
public class Server
{
public static Region LoadRegion(string folderPath, Coordinates coordinates)
{
string fullPath = Path.Combine(folderPath, coordinates.GetRegionHash().ToString());
Console.WriteLine(fullPath);
Region retRegion = new Region(coordinates);
if (!File.Exists(fullPath))
return retRegion;
FileStream fileStream = new FileStream(fullPath, FileMode.Open);
byte[] regionBytes = new byte[fileStream.Length];
fileStream.Read(regionBytes, 0, regionBytes.Length);
fileStream.Close();
return ByteConverter.ToRegion(regionBytes);
}
public static void Main(string[] args)
{
Importer.Split("/home/glax/Downloads/bayern-latest.osm", "/home/glax/Downloads/bayern-latest");
Region r = LoadRegion("/home/glax/Downloads/bayern-latest", new Coordinates(47.890f,12.56f));
//XmlImporter.Split("/home/glax/Downloads/oberbayern-latest.osm", "/home/glax/Downloads/oberbayern-latest");
//Region r = LoadRegion("/home/glax/Downloads/bayern-latest", new Coordinates(47.890f,12.56f));
Pathfinder.CustomAStar("/home/glax/Downloads/oberbayern-latest", new Coordinates(48.243351f, 11.640417f), new Coordinates(48.25239f, 11.53272f));
}
}

View File

@ -8,7 +8,6 @@
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\OSMSplitter\OSMSplitter.csproj" />
<ProjectReference Include="..\Pathfinding\Pathfinding.csproj" />
</ItemGroup>