Compare commits
No commits in common. "a0418a6fae0b9c5402647ebe8a4d55d514d15d65" and "bea789f6258221f239d70afac9034e3c1595d71f" have entirely different histories.
a0418a6fae
...
bea789f625
@ -61,20 +61,14 @@ public class RegionLoader(float regionSize, string? importFolderPath = null, ILo
|
|||||||
{
|
{
|
||||||
ulong node1Id = w.NodeIds[i - 1];
|
ulong node1Id = w.NodeIds[i - 1];
|
||||||
ulong node2Id = w.NodeIds[i];
|
ulong node2Id = w.NodeIds[i];
|
||||||
if (ret.Nodes.TryGetValue(node1Id, out Graph.Node? node1))
|
if (ret.Nodes.TryGetValue(node1Id, out Graph.Node? node1) && ret.Nodes.TryGetValue(node2Id, out Graph.Node? node2))
|
||||||
{
|
{
|
||||||
//TODO add oneway checks
|
|
||||||
node1.Neighbors.TryAdd(node2Id, w.ID);
|
node1.Neighbors.TryAdd(node2Id, w.ID);
|
||||||
}
|
|
||||||
if (ret.Nodes.TryGetValue(node2Id, out Graph.Node? node2))
|
|
||||||
{
|
|
||||||
//TODO add oneway checks
|
|
||||||
node2.Neighbors.TryAdd(node1Id, w.ID);
|
node2.Neighbors.TryAdd(node1Id, w.ID);
|
||||||
|
//TODO add oneway checks
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
nodesReader.Dispose();
|
|
||||||
waysReader.Dispose();
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -82,7 +76,7 @@ public class RegionLoader(float regionSize, string? importFolderPath = null, ILo
|
|||||||
public Graph.Graph? LoadRegionFromNodeId(ulong nodeId)
|
public Graph.Graph? LoadRegionFromNodeId(ulong nodeId)
|
||||||
{
|
{
|
||||||
logger?.LogDebug($"Loading Region for Node {nodeId}");
|
logger?.LogDebug($"Loading Region for Node {nodeId}");
|
||||||
using StreamReader nodesMapFileStream = new(Path.Join(ImportFolderPath, NodesMapRegionFileName), Encoding.ASCII);
|
StreamReader nodesMapFileStream = new(Path.Join(ImportFolderPath, NodesMapRegionFileName), Encoding.ASCII);
|
||||||
while (!nodesMapFileStream.EndOfStream)
|
while (!nodesMapFileStream.EndOfStream)
|
||||||
{
|
{
|
||||||
string? line = nodesMapFileStream.ReadLine();
|
string? line = nodesMapFileStream.ReadLine();
|
||||||
@ -107,7 +101,7 @@ public class RegionLoader(float regionSize, string? importFolderPath = null, ILo
|
|||||||
public Graph.Graph?[] LoadRegionsFromWayId(ulong wayId)
|
public Graph.Graph?[] LoadRegionsFromWayId(ulong wayId)
|
||||||
{
|
{
|
||||||
logger?.LogDebug($"Loading Region for Way {wayId}");
|
logger?.LogDebug($"Loading Region for Way {wayId}");
|
||||||
using StreamReader waysMapFileStream = new(Path.Join(ImportFolderPath, WayMapRegionFileName), Encoding.ASCII);
|
StreamReader waysMapFileStream = new(Path.Join(ImportFolderPath, WayMapRegionFileName), Encoding.ASCII);
|
||||||
while (!waysMapFileStream.EndOfStream)
|
while (!waysMapFileStream.EndOfStream)
|
||||||
{
|
{
|
||||||
string? line = waysMapFileStream.ReadLine();
|
string? line = waysMapFileStream.ReadLine();
|
||||||
|
Loading…
Reference in New Issue
Block a user