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 /****************************************************************************/
9 // Importer for networks stored in Elmar's format
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
12 // Copyright (C) 2008-2014 DLR (http://www.dlr.de/) and contributors
13 /****************************************************************************/
14 //
15 // This file is part of SUMO.
16 // SUMO is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 /****************************************************************************/
22 #ifndef NIImporter_DlrNavteq_h
23 #define NIImporter_DlrNavteq_h
24 
25 
26 // ===========================================================================
27 // included modules
28 // ===========================================================================
29 #ifdef _MSC_VER
30 #include <windows_config.h>
31 #else
32 #include <config.h>
33 #endif
34 
35 #include <string>
36 #include <map>
39 
40 
41 // ===========================================================================
42 // class declarations
43 // ===========================================================================
44 class NBEdgeCont;
45 class NBNetBuilder;
46 class NBNodeCont;
48 class NBTypeCont;
49 class OptionsCont;
50 class PositionVector;
51 class StringTokenizer;
52 
53 
54 // ===========================================================================
55 // class definitions
56 // ===========================================================================
63 public:
75  static void loadNetwork(const OptionsCont& oc, NBNetBuilder& nb);
76 
78  static const int GEO_SCALE;
79 
80 protected:
89  class NodesHandler : public LineHandler {
90  public:
96  NodesHandler(NBNodeCont& nc, const std::string& file,
97  std::map<std::string, PositionVector>& geoms);
98 
99 
101  ~NodesHandler();
102 
103 
115  bool report(const std::string& result);
116 
117 
118  protected:
119  // @brief The node container to store parsed nodes into
121 
123  std::map<std::string, PositionVector>& myGeoms;
124 
125 
126  private:
128  NodesHandler(const NodesHandler&);
129 
132 
133  };
134 
135 
144  class EdgesHandler : public LineHandler {
145 
146  public:
155  const std::string& file,
156  std::map<std::string, PositionVector>& geoms,
157  std::map<std::string, std::string>& streetNames);
158 
159 
161  ~EdgesHandler();
162 
163 
173  bool report(const std::string& result);
174 
175 
176  protected:
179 
182 
184  std::map<std::string, PositionVector>& myGeoms;
185 
187  std::map<std::string, std::string>& myStreetNames;
188 
191 
194 
196  std::vector<int> myColumns;
197 
199  const std::string myFile;
200 
201  static const int MISSING_COLUMN;
202 
203  enum ColumnName {
204  LINK_ID = 0,
229  };
230 
231  std::string getColumn(const StringTokenizer& st, ColumnName name, const std::string fallback = "");
232 
233  private:
235  std::string getStreetNameFromIDs(const std::string& regionalID, const std::string& localID) const;
236 
237 
238  private:
240  EdgesHandler(const EdgesHandler&);
241 
244 
245  };
246 
247 
257  public:
264  NBEdgeCont& ne, const std::string& file);
265 
266 
269 
270 
280  bool report(const std::string& result);
281 
282 
283  protected:
286 
289 
292 
293 
294  private:
297 
300 
301  };
302 
303 
312  class NamesHandler : public LineHandler {
313  public:
318  NamesHandler(const std::string& file, std::map<std::string, std::string>& streetNames);
319 
320 
322  ~NamesHandler();
323 
324 
334  bool report(const std::string& result);
335 
336 
337  protected:
339  std::map<std::string, std::string>& myStreetNames;
340 
341 
342  private:
344  NamesHandler(const NamesHandler&);
345 
348 
349  };
350 
351 };
352 
353 
354 #endif
355 
356 /****************************************************************************/
357