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 
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&#39;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&#39;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&#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.
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
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:221
Container for nodes during the netbuilding process.
Definition: NBNodeCont.h:63
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.