removed old method, changed some speeds

This commit is contained in:
glax 2023-04-09 17:14:14 +02:00
parent ea7ce1f630
commit 13beaeaf73

View File

@ -40,25 +40,6 @@ public class Tag
this.value = value;
}
}
public static Tag FromBytes(byte[] bytes)
{
TagType type = (TagType)bytes[0];
dynamic value = false;
switch (type)
{
case TagType.highway:
case TagType.oneway:
case TagType.forward:
value = BitConverter.ToBoolean(bytes, 1);
break;
case TagType.maxspeed:
value = bytes[1];
break;
}
return new Tag(type, value);
}
public static Tag? ConvertToTag(string key, string value)
{
@ -129,7 +110,7 @@ public class Tag
{ WayType.primary_link, 30 },
{ WayType.secondary_link, 25 },
{ WayType.tertiary_link, 25 },
{ WayType.living_street, 10 },
{ WayType.living_street, 5 },
{ WayType.service, 1 },
{ WayType.pedestrian, 0 },
{ WayType.track, 15 },
@ -148,7 +129,7 @@ public class Tag
};
public static readonly Dictionary<WayType, byte> defaultSpeedPedestrian = new() {
{ WayType.NONE, 0 },
{ WayType.NONE, 1 },
{ WayType.motorway, 0 },
{ WayType.trunk, 0 },
{ WayType.primary, 0 },
@ -168,17 +149,19 @@ public class Tag
{ WayType.bus_guideway, 0 },
{ WayType.escape, 1 },
{ WayType.raceway, 0 },
{ WayType.road, 3 },
{ WayType.road, 2 },
{ WayType.busway, 0 },
{ WayType.footway, 4 },
{ WayType.bridleway, 1 },
{ WayType.steps, 2 },
{ WayType.corridor, 3 },
{ WayType.path, 4 },
{ WayType.cycleway, 2 },
{ WayType.cycleway, 1 },
{ WayType.construction, 0 }
};
// ReSharper disable InconsistentNaming
public enum WayType : byte { NONE, motorway, trunk, primary, secondary, tertiary, unclassified, residential, motorway_link, trunk_link, primary_link, secondary_link, tertiary_link, living_street, service, pedestrian, track, bus_guideway, escape, raceway, road, busway, footway, bridleway, steps, corridor, path, cycleway, construction }
// ReSharper restore InconsistentNaming
public enum SpeedType { pedestrian, car, road }
}