From b12f959f48eb6c755d1d1a6856002e170dad02ea Mon Sep 17 00:00:00 2001 From: glax Date: Sat, 1 Apr 2023 00:40:06 +0200 Subject: [PATCH] Made Fields FileNames public --- Server/RegionConverter.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Server/RegionConverter.cs b/Server/RegionConverter.cs index aa1f355..e42766f 100644 --- a/Server/RegionConverter.cs +++ b/Server/RegionConverter.cs @@ -17,9 +17,9 @@ public class RegionConverter NumberDecimalSeparator = "." }; - private const string NodesFileName = "region.nodes"; - private const string WaysFileName = "region.ways"; - private const string tagsFileName = "waytags"; + public const string NodesFileName = "region.nodes"; + public const string WaysFileName = "region.ways"; + public const string tagsFileName = "waytags"; public static void ConvertXMLToRegions(string filePath, string outputPath) { @@ -43,7 +43,7 @@ public class RegionConverter Dictionary nodeRegions = new(); Dictionary regionFileStreams = new(); Dictionary tmpAllNodes = new(); - bool isHighway = false; + bool isHighway; HashSet currentIds = new(); while (xmlReader.Read()) { @@ -108,6 +108,7 @@ public class RegionConverter return nodeRegions; } + //TODO write all tags in region to single file instead of separate wayfiles private static void ImportWays(XmlReader xmlReader, Dictionary nodeRegions, string outputPath) { BinaryFormatter bFormatter = new BinaryFormatter(); @@ -219,5 +220,9 @@ public class RegionConverter } } xmlReader.Close(); + foreach (FileStream f in regionWaysFileStreams.Values) + { + f.Dispose(); + } } } \ No newline at end of file