Changed Regionhashing and OsmDatastructure with OsmDatastructure.Graph

This commit is contained in:
2023-03-14 17:00:59 +01:00
parent 583fe3c18d
commit d7469aa190
9 changed files with 49 additions and 41 deletions

View File

@ -1,7 +1,7 @@
using System.Globalization;
using System.Xml;
using OSMDatastructure;
using OSMImporter;
using OSMDatastructure.Graph;
namespace Server;
@ -39,10 +39,10 @@ public static class XmlImporter
public static HashSet<Region> SplitIntoRegions(HashSet<OsmNode> nodes)
{
Console.WriteLine(string.Format("[{0}] Splitting into Regions...", DateTime.Now.ToLocalTime()));
Dictionary<ulong, Region> retRegions = new();
Dictionary<int, Region> retRegions = new();
foreach (OsmNode node in nodes)
{
ulong regionHash = node.coordinates.GetRegionHash();
int regionHash = Coordinates.GetRegionHashCode(node.coordinates);
if(retRegions.ContainsKey(regionHash))
{
retRegions[regionHash].nodes.Add(node);
@ -62,7 +62,7 @@ public static class XmlImporter
{
NumberDecimalSeparator = "."
};
private static HashSet<ulong> GetHighwayNodeIds(XmlReader xmlReader)
public static HashSet<ulong> GetHighwayNodeIds(XmlReader xmlReader)
{
HashSet<ulong> retSet = new();
bool isHighway;