From 13beaeaf7353389931f306d05de0c47970530213 Mon Sep 17 00:00:00 2001 From: glax Date: Sun, 9 Apr 2023 17:14:14 +0200 Subject: [PATCH] removed old method, changed some speeds --- OSMDatastructure/Tag.cs | 29 ++++++----------------------- 1 file changed, 6 insertions(+), 23 deletions(-) diff --git a/OSMDatastructure/Tag.cs b/OSMDatastructure/Tag.cs index 6895c37..c8747d3 100644 --- a/OSMDatastructure/Tag.cs +++ b/OSMDatastructure/Tag.cs @@ -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 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 } } \ No newline at end of file