SUMO - Simulation of Urban MObility
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.dlr.de/
12 // Copyright (C) 2008-2016 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:
156  const std::string& file,
157  std::map<std::string, PositionVector>& geoms,
158  std::map<std::string, std::string>& streetNames);
159 
160 
162  ~EdgesHandler();
163 
164 
174  bool report(const std::string& result);
175 
176 
177  protected:
180 
183 
186 
188  std::map<std::string, PositionVector>& myGeoms;
189 
191  std::map<std::string, std::string>& myStreetNames;
192 
195 
198 
200  std::vector<int> myColumns;
201 
203  const std::string myFile;
204 
205  static const int MISSING_COLUMN;
206 
207  enum ColumnName {
208  LINK_ID = 0,
232  CONNECTION
233  };
234 
235  std::string getColumn(const StringTokenizer& st, ColumnName name, const std::string fallback = "");
236 
237  private:
239  std::string getStreetNameFromIDs(const std::string& regionalID, const std::string& localID) const;
240 
241 
242  private:
244  EdgesHandler(const EdgesHandler&);
245 
248 
249  };
250 
251 
261  public:
268  NBEdgeCont& ne, const std::string& file);
269 
270 
273 
274 
284  bool report(const std::string& result);
285 
286 
287  protected:
290 
293 
296 
297 
298  private:
301 
304 
305  };
306 
307 
316  class NamesHandler : public LineHandler {
317  public:
322  NamesHandler(const std::string& file, std::map<std::string, std::string>& streetNames);
323 
324 
326  ~NamesHandler();
327 
328 
338  bool report(const std::string& result);
339 
340 
341  protected:
343  std::map<std::string, std::string>& myStreetNames;
344 
345 
346  private:
348  NamesHandler(const NamesHandler&);
349 
352 
353  };
354 
355 };
356 
357 
358 #endif
359 
360 /****************************************************************************/
361 
NBNodeCont & myNodeCont
The node container to get the referenced nodes from.
bool report(const std::string &result)
Parsing method.
std::map< std::string, std::string > & myStreetNames
Previously read streat names (non-const because operate[] is more convenient)
Importer of street names in DLRNavteq&#39;s (aka elmar) format.
Importer of nodes stored in unsplit elmar format.
A container for traffic light definitions and built programs.
Importer for networks stored in Elmar&#39;s format.
NodesHandler(NBNodeCont &nc, const std::string &file, std::map< std::string, PositionVector > &geoms)
Constructor.
static void loadNetwork(const OptionsCont &oc, NBNetBuilder &nb)
Loads content of the optionally given dlr-navteq (aka Elmar-fomat) folder.
NBEdgeCont & myEdgeCont
The edge container to store loaded edges into.
bool myTryIgnoreNodePositions
Whether node positions shall not be added to the edge&#39;s geometry.
std::map< std::string, PositionVector > & myGeoms
Previously read edge geometries (manipulated during use)
NBNodeCont & myNodeCont
The node container to get the referenced nodes from.
NBTypeCont & myTypeCont
The type container to retrieve type info from.
Importer of traffic lights stored in DLRNavteq&#39;s (aka elmar) format.
Interface definition for a class which retrieves lines from a LineHandler.
Definition: LineHandler.h:52
Importer of edges stored in unsplit elmar format.
A list of positions.
std::map< std::string, PositionVector > & myGeoms
A container for parsed geometries.
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:66
const std::string myFile
the file being parsed
SUMOReal myVersion
version number of current file
NodesHandler & operator=(const NodesHandler &)
Invalidated assignment operator.
NBEdgeCont & myEdgeCont
The edge container to get the referenced edges from.
Instance responsible for building networks.
Definition: NBNetBuilder.h:112
A storage for options typed value containers)
Definition: OptionsCont.h:99
std::map< std::string, std::string > & myStreetNames
The container for storing read names.
NBTrafficLightLogicCont & myTLLogicCont
The traffic lights container to add built tls to.
static const int GEO_SCALE
scaling factor for geo coordinates (DLRNavteq format uses this to increase floating point precisions)...
#define SUMOReal
Definition: config.h:213
Container for nodes during the netbuilding process.
Definition: NBNodeCont.h:63
std::vector< int > myColumns
the version number of the edge file being parsed
A storage for available types of edges.
Definition: NBTypeCont.h:62