Renamed OsmWay -> OsmEdge again

Prevented duplicate writes of Tags for way
This commit is contained in:
2023-04-01 01:47:56 +02:00
parent c2cadd678c
commit 806dcf98c9
5 changed files with 30 additions and 22 deletions

View File

@ -1,7 +1,7 @@
namespace OSMDatastructure.Graph;
[Serializable]
public class OsmWay
public class OsmEdge
{
public ulong wayId { get; }
public ulong startId { get; }
@ -9,7 +9,7 @@ public class OsmWay
public ulong neighborRegion { get; }
public OsmWay(ulong wayId, ulong startId, ulong neighborId, ulong neighborRegion)
public OsmEdge(ulong wayId, ulong startId, ulong neighborId, ulong neighborRegion)
{
this.wayId = wayId;
this.startId = startId;

View File

@ -4,7 +4,7 @@ namespace OSMDatastructure.Graph;
public class OsmNode
{
public ulong nodeId { get; }
public HashSet<OsmWay> edges { get; }
public HashSet<OsmEdge> edges { get; }
public Coordinates coordinates { get; }
[NonSerialized]public OsmNode? previousPathNode = null;
@ -26,9 +26,9 @@ public class OsmNode
this.coordinates = coordinates;
}
public OsmWay? GetEdgeToNode(OsmNode n)
public OsmEdge? GetEdgeToNode(OsmNode n)
{
foreach (OsmWay e in this.edges)
foreach (OsmEdge e in this.edges)
if (e.neighborId == n.nodeId)
return e;
return null;

View File

@ -7,7 +7,7 @@ public class Region
{
[NonSerialized]public const float RegionSize = 0.1f;
public readonly HashSet<OsmNode> nodes = new();
public readonly HashSet<OsmWay> ways = new();
public readonly HashSet<OsmEdge> ways = new();
public ulong regionHash { get; }
public TagManager tagManager { get; }