Compare commits

...

2 Commits

View File

@ -164,12 +164,12 @@ public class Converter(float regionSize, string? exportFolderPath = null, ILogge
public void RemoveAllNonHighways() public void RemoveAllNonHighways()
{ {
string[] wayRegionsPaths = Directory.GetFiles(Path.Join(ExportFolderPath, WaysRegionDirectory)).Where(file => !Regex.IsMatch(file, @"[0-9]+\..*")).ToArray(); string[] wayRegionsPaths = Directory.GetFiles(Path.Join(ExportFolderPath, WaysRegionDirectory)).Where(file => Regex.IsMatch(file, @"[0-9]+")).ToArray();
int count = 0; int count = 0;
DateTime print = DateTime.Now; DateTime print = DateTime.Now;
DateTime start = DateTime.Now; DateTime start = DateTime.Now;
List<ulong> wayIds = new(); HashSet<ulong> wayIds = new();
List<ulong> nodeIds = new(); HashSet<ulong> nodeIds = new();
foreach (string path in wayRegionsPaths) foreach (string path in wayRegionsPaths)
{ {
if (DateTime.Now - print > TimeSpan.FromSeconds(2)) if (DateTime.Now - print > TimeSpan.FromSeconds(2))
@ -198,7 +198,8 @@ public class Converter(float regionSize, string? exportFolderPath = null, ILogge
{ {
waysStreamWriter.WriteLine(line); waysStreamWriter.WriteLine(line);
wayIds.Add(w.ID); wayIds.Add(w.ID);
nodeIds.AddRange(w.NodeIds); foreach (ulong nodeId in w.NodeIds)
nodeIds.Add(nodeId);
hasWritten = true; hasWritten = true;
}else }else
logger?.LogTrace($"Way {w.ID} is not a highway. BYE!"); logger?.LogTrace($"Way {w.ID} is not a highway. BYE!");