From 8c8aadc2e1e32c4cfdf0513bd2d0f55897b486ee Mon Sep 17 00:00:00 2001 From: C9Glax <13404778+C9Glax@users.noreply.github.com> Date: Sun, 5 Feb 2023 20:00:00 +0100 Subject: [PATCH] Split highwayType.cs into multipleFiles and added most common tags --- OSMDatastructure/Connection.cs | 24 +++++++++++++++++++----- OSMDatastructure/cyclewayType.cs | 13 +++++++++++++ OSMDatastructure/footwayType.cs | 7 +++++++ OSMDatastructure/highwayType.cs | 31 ------------------------------- OSMDatastructure/sidewalkSide.cs | 9 +++++++++ 5 files changed, 48 insertions(+), 36 deletions(-) create mode 100644 OSMDatastructure/cyclewayType.cs create mode 100644 OSMDatastructure/footwayType.cs create mode 100644 OSMDatastructure/sidewalkSide.cs diff --git a/OSMDatastructure/Connection.cs b/OSMDatastructure/Connection.cs index f59b308..717db11 100644 --- a/OSMDatastructure/Connection.cs +++ b/OSMDatastructure/Connection.cs @@ -6,11 +6,11 @@ namespace OSMDatastructure public Coordinates endNodeCoordinates { get; } - private readonly Dictionary _tags = new Dictionary(); + private readonly Dictionary _tags = new(); public enum tagType : byte { - highway, oneway, footway, sidewalk, cycleway, busway, forward, maxspeed, unknown + highway, oneway, footway, sidewalk, cycleway, busway, forward, maxspeed, name, surface, lanes, access, tracktype } public Connection(ulong endNodeId, Coordinates endNodeCoordinates) @@ -62,12 +62,26 @@ namespace OSMDatastructure this._tags.Add(tagType.footway, cwType); break; case "busway": - if(Enum.TryParse(value, out buswayType bwType)) - this._tags.Add(tagType.footway, bwType); + //TODO break; case "maxspeed": this._tags.Add(tagType.maxspeed, Convert.ToByte(value)); break; + case "name": + //TODO + break; + case "surface": + //TODO + break; + case "lanes": + //TODO + break; + case "access": + //TODO + break; + case "tracktype": + //TODO + break; default: Console.WriteLine("Unknown Tag: {0} Value: {1}", key, value); break; @@ -94,7 +108,7 @@ namespace OSMDatastructure this._tags.Add(tagType.cycleway, (cyclewayType)value); break; case tagType.busway: - this._tags.Add(tagType.busway, (buswayType)value); + //TODO break; case tagType.maxspeed: this._tags.Add(tagType.maxspeed, value); diff --git a/OSMDatastructure/cyclewayType.cs b/OSMDatastructure/cyclewayType.cs new file mode 100644 index 0000000..afff7b9 --- /dev/null +++ b/OSMDatastructure/cyclewayType.cs @@ -0,0 +1,13 @@ +namespace OSMDatastructure; + +public enum cyclewayType : byte +{ + lane, + opposite, + opposite_lane, + track, + opposite_track, + share_busway, + opposite_share_busway, + shared_lane +} \ No newline at end of file diff --git a/OSMDatastructure/footwayType.cs b/OSMDatastructure/footwayType.cs new file mode 100644 index 0000000..b4fef67 --- /dev/null +++ b/OSMDatastructure/footwayType.cs @@ -0,0 +1,7 @@ +namespace OSMDatastructure; + +public enum footwayType : byte +{ + sidewalk, + crossing +} \ No newline at end of file diff --git a/OSMDatastructure/highwayType.cs b/OSMDatastructure/highwayType.cs index 4a51991..89f22f1 100644 --- a/OSMDatastructure/highwayType.cs +++ b/OSMDatastructure/highwayType.cs @@ -33,35 +33,4 @@ namespace OSMDatastructure proposed, construction } - - public enum footwayType : byte - { - sidewalk, - crossing - } - - public enum cyclewayType : byte - { - lane, - opposite, - opposite_lane, - track, - opposite_track, - share_busway, - opposite_share_busway, - shared_lane - } - - public enum sidewalkSide : byte - { - both, - left, - right, - no - } - - public enum buswayType : byte - { - lane - } } \ No newline at end of file diff --git a/OSMDatastructure/sidewalkSide.cs b/OSMDatastructure/sidewalkSide.cs new file mode 100644 index 0000000..1efd141 --- /dev/null +++ b/OSMDatastructure/sidewalkSide.cs @@ -0,0 +1,9 @@ +namespace OSMDatastructure; + +public enum sidewalkSide : byte +{ + both, + left, + right, + no +} \ No newline at end of file