Renamed OsmEdge to OsmWay and added startnodeid (for serialization)
This commit is contained in:
parent
255d924dc4
commit
ac77708834
@ -4,7 +4,7 @@ namespace OSMDatastructure.Graph;
|
||||
public class OsmNode
|
||||
{
|
||||
public ulong nodeId { get; }
|
||||
public HashSet<OsmEdge> edges { get; }
|
||||
public HashSet<OsmWay> edges { get; }
|
||||
public Coordinates coordinates { get; }
|
||||
|
||||
[NonSerialized]public OsmNode? previousPathNode = null;
|
||||
@ -26,9 +26,9 @@ public class OsmNode
|
||||
this.coordinates = coordinates;
|
||||
}
|
||||
|
||||
public OsmEdge? GetEdgeToNode(OsmNode n)
|
||||
public OsmWay? GetEdgeToNode(OsmNode n)
|
||||
{
|
||||
foreach (OsmEdge e in this.edges)
|
||||
foreach (OsmWay e in this.edges)
|
||||
if (e.neighborId == n.nodeId)
|
||||
return e;
|
||||
return null;
|
||||
|
@ -1,17 +1,19 @@
|
||||
namespace OSMDatastructure.Graph;
|
||||
|
||||
[Serializable]
|
||||
public class OsmEdge
|
||||
public class OsmWay
|
||||
{
|
||||
public ulong wayId { get; }
|
||||
public ulong startId { get; }
|
||||
public ulong neighborId { get; }
|
||||
public ulong neighborRegion { get; }
|
||||
|
||||
|
||||
public OsmEdge(ulong wayID, ulong neighborID, ulong neighborRegion)
|
||||
public OsmWay(ulong wayId, ulong startId, ulong neighborId, ulong neighborRegion)
|
||||
{
|
||||
this.wayId = wayID;
|
||||
this.neighborId = neighborID;
|
||||
this.wayId = wayId;
|
||||
this.startId = startId;
|
||||
this.neighborId = neighborId;
|
||||
this.neighborRegion = neighborRegion;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user