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