2023-02-06 17:32:55 +01:00
|
|
|
namespace OSMDatastructure;
|
2023-02-02 22:30:43 +01:00
|
|
|
|
2023-02-06 17:32:55 +01:00
|
|
|
public class Region
|
|
|
|
{
|
|
|
|
public const float regionSize = 0.01f;
|
|
|
|
public readonly HashSet<OsmNode> nodes = new();
|
|
|
|
public ulong regionHash { get; }
|
2023-02-03 21:13:51 +01:00
|
|
|
|
2023-02-06 17:32:55 +01:00
|
|
|
public Region(ulong regionHash)
|
|
|
|
{
|
|
|
|
this.regionHash = regionHash;
|
|
|
|
}
|
2023-02-05 20:02:22 +01:00
|
|
|
|
2023-02-06 17:32:55 +01:00
|
|
|
public Region(Coordinates regionCoordinates)
|
|
|
|
{
|
|
|
|
this.regionHash = regionCoordinates.GetRegionHash();
|
|
|
|
}
|
2023-02-05 20:02:22 +01:00
|
|
|
|
2023-02-06 17:32:55 +01:00
|
|
|
public OsmNode? GetNode(Coordinates coordinates)
|
|
|
|
{
|
|
|
|
foreach(OsmNode node in this.nodes)
|
|
|
|
if (node.coordinates.Equals(coordinates))
|
|
|
|
return node;
|
|
|
|
return null;
|
2023-02-02 22:30:43 +01:00
|
|
|
}
|
|
|
|
}
|