SUMO - Simulation of Urban MObility
NWWriter_DlrNavteq.h
Go to the documentation of this file.
1 /****************************************************************************/
8 // Exporter writing networks using DlrNavteq (Elmar) format
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
11 // Copyright (C) 2012-2017 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 NWWriter_DlrNavteq_h
22 #define NWWriter_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 NBEdge;
44 class NBEdgeCont;
45 class NBNetBuilder;
46 class NBNode;
47 class NBNodeCont;
49 class NBTypeCont;
50 class OptionsCont;
51 
52 
53 // ===========================================================================
54 // class definitions
55 // ===========================================================================
62 public:
68  static void writeNetwork(const OptionsCont& oc, NBNetBuilder& nb);
69 
71  static int getRoadClass(NBEdge* edge);
72 
74  static int getBrunnelType(NBEdge* edge);
75 
77  static int getFormOfWay(NBEdge* edge);
78 
79 private:
86  static void writeNodesUnsplitted(const OptionsCont& oc, NBNodeCont& nc, NBEdgeCont& ec, std::map<NBEdge*, std::string>& internalNodes);
87 
93  static void writeLinksUnsplitted(const OptionsCont& oc, NBEdgeCont& ec, std::map<NBEdge*, std::string>& internalNodes);
94 
99  static void writeTrafficSignals(const OptionsCont& oc, NBNodeCont& nc);
100 
101 
106  static void writeProhibitedManoeuvres(const OptionsCont& oc, const NBNodeCont& nc, const NBEdgeCont& ec);
107 
112  static void writeConnectedLanes(const OptionsCont& oc, NBNodeCont& nc);
113 
115  static void writeHeader(OutputDevice& device, const OptionsCont& oc);
116 
118  static std::string getAllowedTypes(SVCPermissions permissions);
119 
121  static int getSpeedCategory(int kph);
122 
124  static int getSpeedCategoryUpperBound(int kph);
125 
127  static int getNavteqLaneCode(const int numLanes);
128 
130  static double getGraphLength(NBEdge* edge);
131 
132  static std::string getSinglePostalCode(const std::string& zipCode, const std::string edgeID);
133 
135  static const std::string UNDEFINED;
136 
138  static inline int speedInKph(double metersPerSecond) {
139  return (int)std::floor(metersPerSecond * 3.6 + 0.5);
140  }
141 };
142 
143 
144 #endif
145 
146 /****************************************************************************/
147 
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:71
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:114
A storage for options typed value containers)
Definition: OptionsCont.h:99
Represents a single node (junction) during network building.
Definition: NBNode.h:75
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:71
Container for nodes during the netbuilding process.
Definition: NBNodeCont.h:63
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:62