SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NIImporter_DlrNavteq.h
Go to the documentation of this file.
1 /****************************************************************************/
8 // Importer for networks stored in Elmar's format
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
11 // Copyright (C) 2001-2013 DLR (http://www.dlr.de/) and contributors
12 /****************************************************************************/
13 //
14 // This file is part of SUMO.
15 // SUMO is free software: you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation, either version 3 of the License, or
18 // (at your option) any later version.
19 //
20 /****************************************************************************/
21 #ifndef NIImporter_DlrNavteq_h
22 #define NIImporter_DlrNavteq_h
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #include <string>
35 #include <map>
38 
39 
40 // ===========================================================================
41 // class declarations
42 // ===========================================================================
43 class NBEdgeCont;
44 class NBNetBuilder;
45 class NBNodeCont;
47 class NBTypeCont;
48 class OptionsCont;
49 class PositionVector;
50 class StringTokenizer;
51 
52 
53 // ===========================================================================
54 // class definitions
55 // ===========================================================================
62 public:
74  static void loadNetwork(const OptionsCont& oc, NBNetBuilder& nb);
75 
77  static const int GEO_SCALE;
78 
79 protected:
88  class NodesHandler : public LineHandler {
89  public:
95  NodesHandler(NBNodeCont& nc, const std::string& file,
96  std::map<std::string, PositionVector>& geoms);
97 
98 
100  ~NodesHandler();
101 
102 
114  bool report(const std::string& result);
115 
116 
117  protected:
118  // @brief The node container to store parsed nodes into
120 
122  std::map<std::string, PositionVector>& myGeoms;
123 
124 
125  private:
127  NodesHandler(const NodesHandler&);
128 
131 
132  };
133 
134 
143  class EdgesHandler : public LineHandler {
144 
145  public:
154  const std::string& file,
155  std::map<std::string, PositionVector>& geoms,
156  std::map<std::string, std::string>& streetNames);
157 
158 
160  ~EdgesHandler();
161 
162 
172  bool report(const std::string& result);
173 
174 
175  protected:
178 
181 
183  std::map<std::string, PositionVector>& myGeoms;
184 
186  std::map<std::string, std::string>& myStreetNames;
187 
190 
193 
195  std::vector<int> myColumns;
196 
198  const std::string myFile;
199 
200  static const int MISSING_COLUMN;
201 
202  enum ColumnName {
203  LINK_ID = 0,
228  };
229 
230  std::string getColumn(const StringTokenizer& st, ColumnName name, const std::string fallback = "");
231 
232  private:
234  std::string getStreetNameFromIDs(const std::string& regionalID, const std::string& localID) const;
235 
236 
237  private:
239  EdgesHandler(const EdgesHandler&);
240 
243 
244  };
245 
246 
256  public:
263  NBEdgeCont& ne, const std::string& file);
264 
265 
268 
269 
279  bool report(const std::string& result);
280 
281 
282  protected:
285 
288 
291 
292 
293  private:
296 
299 
300  };
301 
302 
311  class NamesHandler : public LineHandler {
312  public:
317  NamesHandler(const std::string& file, std::map<std::string, std::string>& streetNames);
318 
319 
321  ~NamesHandler();
322 
323 
333  bool report(const std::string& result);
334 
335 
336  protected:
338  std::map<std::string, std::string>& myStreetNames;
339 
340 
341  private:
343  NamesHandler(const NamesHandler&);
344 
347 
348  };
349 
350 };
351 
352 
353 #endif
354 
355 /****************************************************************************/
356