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 
bool report(const std::string &result)
Parsing method.
NBNodeCont & myNodeCont
The node container to get the referenced nodes from.
bool report(const std::string &result)
Parsing method.
EdgesHandler & operator=(const EdgesHandler &)
Invalidated assignment operator.
std::map< std::string, std::string > & myStreetNames
Previously read streat names (non-const because operate[] is more convenient)
Importer of street names in DLRNavteq's (aka elmar) format.
Importer of nodes stored in unsplit elmar format.
A container for traffic light definitions and built programs.
bool report(const std::string &result)
Parsing method.
Importer for networks stored in Elmar's format.
NodesHandler(NBNodeCont &nc, const std::string &file, std::map< std::string, PositionVector > &geoms)
Constructor.
TrafficlightsHandler & operator=(const TrafficlightsHandler &)
Invalidated assignment operator.
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'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.
Importer of traffic lights stored in DLRNavteq's (aka elmar) format.
Interface definition for a class which retrieves lines from a LineHandler.
Definition: LineHandler.h:52
NamesHandler & operator=(const NamesHandler &)
Invalidated assignment operator.
Importer of edges stored in unsplit elmar format.
NamesHandler(const std::string &file, std::map< std::string, std::string > &streetNames)
Constructor.
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.
std::string getStreetNameFromIDs(const std::string &regionalID, const std::string &localID) const
build the street name for the given ids
NBEdgeCont & myEdgeCont
The edge container to get the referenced edges from.
EdgesHandler(NBNodeCont &nc, NBEdgeCont &ec, const std::string &file, std::map< std::string, PositionVector > &geoms, std::map< std::string, std::string > &streetNames)
Constructor.
Instance responsible for building networks.
Definition: NBNetBuilder.h:113
A storage for options typed value containers)
Definition: OptionsCont.h:108
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:215
Container for nodes during the netbuilding process.
Definition: NBNodeCont.h:64
TrafficlightsHandler(NBNodeCont &nc, NBTrafficLightLogicCont &tlc, NBEdgeCont &ne, const std::string &file)
Constructor.
std::vector< int > myColumns
the version number of the edge file being parsed
A storage for available types of edges.
Definition: NBTypeCont.h:56
std::string getColumn(const StringTokenizer &st, ColumnName name, const std::string fallback="")
bool report(const std::string &result)
Parsing method.