From d2ab990bfe921e62a70be8182097c780ac9cb38e Mon Sep 17 00:00:00 2001 From: C9Glax <13404778+C9Glax@users.noreply.github.com> Date: Tue, 14 Mar 2023 17:01:48 +0100 Subject: [PATCH] new env --- Server/Server.cs | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/Server/Server.cs b/Server/Server.cs index 78a376e..eed9475 100644 --- a/Server/Server.cs +++ b/Server/Server.cs @@ -1,28 +1,18 @@ using OSMDatastructure; +using OSMDatastructure.Graph; + using Pathfinding; namespace Server; public class Server { - private static void WriteRegionsToFile(HashSet regions, string outputFolderPath) - { - Console.WriteLine(string.Format("[{0}] Writing files...", DateTime.Now.ToLocalTime())); - Directory.CreateDirectory(outputFolderPath); - foreach (Region region in regions) - { - FileStream regionFileStream = - new FileStream(Path.Combine(outputFolderPath, region.regionHash.ToString()), FileMode.Create); - regionFileStream.Write(ByteConverter.GetBytes(region)); - regionFileStream.Close(); - } - } public static void Main(string[] args) { - HashSet nodes = XmlImporter.ImportXml("/home/glax/Downloads/germany-latest.osm"); + HashSet nodes = XmlImporter.ImportXml("D:/stuttgart-regbez-latest.osm/stuttgart-regbez-latest.osm"); HashSet regions = XmlImporter.SplitIntoRegions(nodes); - WriteRegionsToFile(regions, "/home/glax/Downloads/germany-latest"); + WriteRegionsToFile(regions, "D:/stuttgart-regbez"); /* Coordinates start = new Coordinates(48.243351f, 11.640417f); @@ -41,4 +31,17 @@ public class Server } Console.WriteLine();*/ } + + private static void WriteRegionsToFile(HashSet regions, string outputFolderPath) + { + Console.WriteLine(string.Format("[{0}] Writing files...", DateTime.Now.ToLocalTime())); + Directory.CreateDirectory(outputFolderPath); + foreach (Region region in regions) + { + FileStream regionFileStream = + new FileStream(Path.Combine(outputFolderPath, region.regionHash.ToString()), FileMode.Create); + regionFileStream.Write(ByteConverter.GetBytes(region)); + regionFileStream.Close(); + } + } } \ No newline at end of file