public static void Main(string[] args)
""generator"": ""Overpass API 0.7.55.7 8b86ff77"",
""timestamp_osm_base"": ""2019-05-21T18:03:02Z"",
""copyright"": ""The data included in this document is from www.openstreetmap.org. The data is made available under ODbL.""
""highway"": ""turning_circle""
""highway"": ""residential"",
""name"": ""West Apple Street"",
""tiger:county"": ""Luna, NM"",
""tiger:name_base"": ""Apple"",
""tiger:name_direction_prefix"": ""W"",
""tiger:name_type"": ""St"",
""tiger:reviewed"": ""no""
var json = JsonConvert.DeserializeObject<OSMdata>(jsonText);
foreach (Element jsonElement in json.elements)
Console.WriteLine(jsonElement.GetType());
public float version { get; set; }
public string generator { get; set; }
public Osm3s osm3s { get; set; }
[JsonConverter(typeof(JsonSubtypes), "type")]
public Element[] elements { get; set; }
public DateTime timestamp_osm_base { get; set; }
public string copyright { get; set; }
[JsonConverter(typeof(JsonSubtypes), "type")]
[JsonSubtypes.KnownSubType(typeof(Node), "node")]
[JsonSubtypes.KnownSubType(typeof(Edge), "way")]
public abstract class Element : OSMdata
public abstract string type { get; }
public class Node : Element
public override string type { get { return "node"; } }
public long id { get; set; }
public float lat { get; set; }
public float lon { get; set; }
public NodeTags tags { get; set; }
public string highway { get; set; }
public string _ref { get; set; }
public class Edge : Element
public override string type { get { return "way"; } }
public long id { get; set; }
public long[] nodes { get; set; }
public EdgeTags tags { get; set; }
public string highway { get; set; }
public string name { get; set; }
public string cfcc { get; set; }
public string county { get; set; }
public string oneway { get; set; }