Moved RegionManager inside of Importer as RegionStruct,
Moved Regionsize var to Region
This commit is contained in:
@ -2,17 +2,18 @@ namespace OSMDatastructure
|
||||
{
|
||||
public class Region
|
||||
{
|
||||
public const float regionSize = 0.01f;
|
||||
private readonly Dictionary<ulong, Node> _nodesInRegion = new();
|
||||
public ulong regionHash { get; }
|
||||
|
||||
public Region(Coordinates regionCoordinates, float regionSize)
|
||||
public Region(Coordinates regionCoordinates)
|
||||
{
|
||||
this.regionHash = regionCoordinates.GetRegionHash(regionSize);
|
||||
this.regionHash = regionCoordinates.GetRegionHash();
|
||||
}
|
||||
|
||||
public Region(ulong nodeId, Node firstNode, float regionSize)
|
||||
public Region(ulong nodeId, Node firstNode)
|
||||
{
|
||||
this.regionHash = firstNode.GetRegionHash(regionSize);
|
||||
this.regionHash = firstNode.GetRegionHash();
|
||||
this._nodesInRegion.Add(nodeId, value: firstNode);
|
||||
}
|
||||
|
||||
@ -31,5 +32,10 @@ namespace OSMDatastructure
|
||||
return this._nodesInRegion;
|
||||
}
|
||||
|
||||
public Node? GetNode(ulong id)
|
||||
{
|
||||
return this._nodesInRegion.ContainsKey(id) ? this._nodesInRegion[id] : null;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user