Fixes for oneway-change

This commit is contained in:
glax 2023-04-09 23:55:24 +02:00
parent 874d60992e
commit 6b496957d7
3 changed files with 8 additions and 7 deletions

View File

@ -62,13 +62,11 @@ public class Tag
byte speed = Convert.ToByte(value);
if (speed != 255)
ret.Add(new Tag(TagType.maxspeed, speed));
break;
}
catch (Exception)
{
ret.Add(new Tag(TagType.maxspeed, byte.MinValue));
}
break;
case "oneway":
switch (value)
@ -84,7 +82,8 @@ public class Tag
ret.Add(new Tag(TagType.oneway, false));
break;
}
return null;
break;
case "name":
ret.Add(new Tag(TagType.name, value));
break;

View File

@ -26,8 +26,9 @@ public class TagManager
public void AddTag(ulong wayId, string key, string value)
{
HashSet<Tag> pTags = Tag.ConvertToTags(key, value);
foreach (Tag pTag in pTags)
AddTag(wayId, pTag);
if(pTags.Count > 0)
foreach (Tag pTag in pTags)
AddTag(wayId, pTag);
}
public void AddTag(ulong wayId, Tag tag)

View File

@ -130,8 +130,9 @@ public class RegionConverter
if (wayReader.Name == "tag")
{
HashSet<Tag> pTags = Tag.ConvertToTags(wayReader.GetAttribute("k")!, wayReader.GetAttribute("v")!);
foreach (Tag pTag in pTags)
currentTags.TryAdd(pTag.key, pTag.value);
if(pTags.Count > 0)
foreach (Tag pTag in pTags)
currentTags.TryAdd(pTag.key, pTag.value);
}
else if (wayReader.Name == "nd")
{