OsmObjects.cs 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. namespace FastReport.Map.Import.Osm
  5. {
  6. internal class OsmNode
  7. {
  8. #region Fields
  9. private double lat;
  10. private double lon;
  11. private bool hasParent;
  12. private Dictionary<string, string> tags;
  13. #endregion // Fields
  14. #region Properties
  15. public double Lat
  16. {
  17. get { return lat; }
  18. set { lat = value; }
  19. }
  20. public double Lon
  21. {
  22. get { return lon; }
  23. set { lon = value; }
  24. }
  25. public bool HasParent
  26. {
  27. get { return hasParent; }
  28. set { hasParent = value; }
  29. }
  30. public Dictionary<string, string> Tags
  31. {
  32. get { return tags; }
  33. set { tags = value; }
  34. }
  35. #endregion // Properties
  36. #region Constructors
  37. public OsmNode(double lat, double lon)
  38. {
  39. this.lat = lat;
  40. this.lon = lon;
  41. hasParent = false;
  42. }
  43. public OsmNode(double lat, double lon, Dictionary<string, string> tags)
  44. {
  45. this.lat = lat;
  46. this.lon = lon;
  47. hasParent = false;
  48. this.tags = tags;
  49. }
  50. #endregion // Constructors
  51. }
  52. internal class OsmWay
  53. {
  54. #region Fields
  55. private List<ulong> nodeRefs;
  56. private Dictionary<string, string> tags;
  57. #endregion // Fields
  58. #region Properties
  59. public List<ulong> NodeRefs
  60. {
  61. get { return nodeRefs; }
  62. set { nodeRefs = value; }
  63. }
  64. public Dictionary<string, string> Tags
  65. {
  66. get { return tags; }
  67. set { tags = value; }
  68. }
  69. #endregion // Properties
  70. #region Constructors
  71. public OsmWay(List<ulong> nodeRefs)
  72. {
  73. this.nodeRefs = nodeRefs;
  74. }
  75. public OsmWay(List<ulong> nodeRefs, Dictionary<string, string> tags)
  76. {
  77. this.nodeRefs = nodeRefs;
  78. this.tags = tags;
  79. }
  80. #endregion // Constructors
  81. }
  82. internal class OsmRelation
  83. {
  84. #region Fields
  85. private List<ulong> nodeRefs;
  86. private List<ulong> wayRefs;
  87. #endregion // Fields
  88. #region Properties
  89. public List<ulong> NodeRefs
  90. {
  91. get { return nodeRefs; }
  92. set { nodeRefs = value; }
  93. }
  94. public List<ulong> WayRefs
  95. {
  96. get { return wayRefs; }
  97. set { wayRefs = value; }
  98. }
  99. #endregion // Properties
  100. #region Constructors
  101. public OsmRelation(List<ulong> nodeRefs, List<ulong> wayRefs)
  102. {
  103. this.nodeRefs = nodeRefs;
  104. this.wayRefs = wayRefs;
  105. }
  106. #endregion // Constructors
  107. }
  108. }