SUMO - Simulation of Urban MObility
NWWriter_DlrNavteq.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2012-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
18 // Exporter writing networks using DlrNavteq (Elmar) format
19 /****************************************************************************/
20 #ifndef NWWriter_DlrNavteq_h
21 #define NWWriter_DlrNavteq_h
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #include <string>
34 #include <map>
37 
38 
39 // ===========================================================================
40 // class declarations
41 // ===========================================================================
42 class NBEdge;
43 class NBEdgeCont;
44 class NBNetBuilder;
45 class NBNode;
46 class NBNodeCont;
48 class NBTypeCont;
49 class OptionsCont;
50 
51 
52 // ===========================================================================
53 // class definitions
54 // ===========================================================================
61 public:
67  static void writeNetwork(const OptionsCont& oc, NBNetBuilder& nb);
68 
70  static int getRoadClass(NBEdge* edge);
71 
73  static int getBrunnelType(NBEdge* edge);
74 
76  static int getFormOfWay(NBEdge* edge);
77 
78 private:
85  static void writeNodesUnsplitted(const OptionsCont& oc, NBNodeCont& nc, NBEdgeCont& ec, std::map<NBEdge*, std::string>& internalNodes);
86 
92  static void writeLinksUnsplitted(const OptionsCont& oc, NBEdgeCont& ec, std::map<NBEdge*, std::string>& internalNodes);
93 
98  static void writeTrafficSignals(const OptionsCont& oc, NBNodeCont& nc);
99 
100 
105  static void writeProhibitedManoeuvres(const OptionsCont& oc, const NBNodeCont& nc, const NBEdgeCont& ec);
106 
111  static void writeConnectedLanes(const OptionsCont& oc, NBNodeCont& nc);
112 
114  static void writeHeader(OutputDevice& device, const OptionsCont& oc);
115 
117  static std::string getAllowedTypes(SVCPermissions permissions);
118 
120  static int getSpeedCategory(int kph);
121 
123  static int getSpeedCategoryUpperBound(int kph);
124 
126  static int getNavteqLaneCode(const int numLanes);
127 
129  static double getGraphLength(NBEdge* edge);
130 
131  static std::string getSinglePostalCode(const std::string& zipCode, const std::string edgeID);
132 
134  static const std::string UNDEFINED;
135 
137  static inline int speedInKph(double metersPerSecond) {
138  return (int)std::floor(metersPerSecond * 3.6 + 0.5);
139  }
140 };
141 
142 
143 #endif
144 
145 /****************************************************************************/
146 
static double getGraphLength(NBEdge *edge)
get the length of the edge when measured up to the junction center
static void writeHeader(OutputDevice &device, const OptionsCont &oc)
write header comments (input paramters, date, etc...)
A container for traffic light definitions and built programs.
static int getRoadClass(NBEdge *edge)
get the navteq road class
static int speedInKph(double metersPerSecond)
get edge speed rounded to kmh
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
static int getSpeedCategory(int kph)
get the navteq speed class based on the speed in km/h
The representation of a single edge during network building.
Definition: NBEdge.h:70
static void writeLinksUnsplitted(const OptionsCont &oc, NBEdgeCont &ec, std::map< NBEdge *, std::string > &internalNodes)
Writes the links_unsplitted file.
static void writeProhibitedManoeuvres(const OptionsCont &oc, const NBNodeCont &nc, const NBEdgeCont &ec)
Writes the prohibited_manoeuvres file.
Exporter writing networks using XML (native input) format.
static int getSpeedCategoryUpperBound(int kph)
get the SPEED_LIMIT as defined by elmar (upper bound of speed category)
static const std::string UNDEFINED
magic value for undefined stuff
static int getNavteqLaneCode(const int numLanes)
get the lane number encoding
static void writeConnectedLanes(const OptionsCont &oc, NBNodeCont &nc)
Writes the connected_lanes file.
static std::string getSinglePostalCode(const std::string &zipCode, const std::string edgeID)
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:66
static void writeNetwork(const OptionsCont &oc, NBNetBuilder &nb)
Writes the network into XML-files (nodes, edges, connections, traffic lights)
static std::string getAllowedTypes(SVCPermissions permissions)
build the ascii-bit-vector for column vehicle_type
Instance responsible for building networks.
Definition: NBNetBuilder.h:115
A storage for options typed value containers)
Definition: OptionsCont.h:98
Represents a single node (junction) during network building.
Definition: NBNode.h:74
static int getBrunnelType(NBEdge *edge)
get the navteq brunnel type
static int getFormOfWay(NBEdge *edge)
get the form of way
static void writeTrafficSignals(const OptionsCont &oc, NBNodeCont &nc)
Writes the traffic_signals file.
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:70
Container for nodes during the netbuilding process.
Definition: NBNodeCont.h:66
static void writeNodesUnsplitted(const OptionsCont &oc, NBNodeCont &nc, NBEdgeCont &ec, std::map< NBEdge *, std::string > &internalNodes)
Writes the nodes_unsplitted file.
A storage for available types of edges.
Definition: NBTypeCont.h:61