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 class OsmNode
|
||||||
{
|
{
|
||||||
public ulong nodeId { get; }
|
public ulong nodeId { get; }
|
||||||
public HashSet<OsmEdge> edges { get; }
|
public HashSet<OsmWay> edges { get; }
|
||||||
public Coordinates coordinates { get; }
|
public Coordinates coordinates { get; }
|
||||||
|
|
||||||
[NonSerialized]public OsmNode? previousPathNode = null;
|
[NonSerialized]public OsmNode? previousPathNode = null;
|
||||||
@ -26,9 +26,9 @@ public class OsmNode
|
|||||||
this.coordinates = coordinates;
|
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)
|
if (e.neighborId == n.nodeId)
|
||||||
return e;
|
return e;
|
||||||
return null;
|
return null;
|
||||||
|
@ -1,17 +1,19 @@
|
|||||||
namespace OSMDatastructure.Graph;
|
namespace OSMDatastructure.Graph;
|
||||||
|
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class OsmEdge
|
public class OsmWay
|
||||||
{
|
{
|
||||||
public ulong wayId { get; }
|
public ulong wayId { get; }
|
||||||
|
public ulong startId { get; }
|
||||||
public ulong neighborId { get; }
|
public ulong neighborId { get; }
|
||||||
public ulong neighborRegion { 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.wayId = wayId;
|
||||||
this.neighborId = neighborID;
|
this.startId = startId;
|
||||||
|
this.neighborId = neighborId;
|
||||||
this.neighborRegion = neighborRegion;
|
this.neighborRegion = neighborRegion;
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue
Block a user