Eclipse 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-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
15 // Exporter writing networks using DlrNavteq (Elmar) format
16 /****************************************************************************/
17 #ifndef NWWriter_DlrNavteq_h
18 #define NWWriter_DlrNavteq_h
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include <config.h>
25 
26 #include <string>
27 #include <map>
30 
31 
32 // ===========================================================================
33 // class declarations
34 // ===========================================================================
35 class NBEdge;
36 class NBEdgeCont;
37 class NBNetBuilder;
38 class NBNode;
39 class NBNodeCont;
41 class NBTypeCont;
42 class OptionsCont;
43 
44 
45 // ===========================================================================
46 // class definitions
47 // ===========================================================================
54 public:
60  static void writeNetwork(const OptionsCont& oc, NBNetBuilder& nb);
61 
63  static int getRoadClass(NBEdge* edge);
64 
66  static int getBrunnelType(NBEdge* edge);
67 
69  static int getFormOfWay(NBEdge* edge);
70 
71 private:
78  static void writeNodesUnsplitted(const OptionsCont& oc, NBNodeCont& nc, NBEdgeCont& ec, std::map<NBEdge*, std::string>& internalNodes);
79 
85  static void writeLinksUnsplitted(const OptionsCont& oc, NBEdgeCont& ec, std::map<NBEdge*, std::string>& internalNodes);
86 
91  static void writeTrafficSignals(const OptionsCont& oc, NBNodeCont& nc);
92 
93 
98  static void writeProhibitedManoeuvres(const OptionsCont& oc, const NBNodeCont& nc, const NBEdgeCont& ec);
99 
104  static void writeConnectedLanes(const OptionsCont& oc, NBNodeCont& nc);
105 
107  static void writeHeader(OutputDevice& device, const OptionsCont& oc);
108 
110  static std::string getAllowedTypes(SVCPermissions permissions);
111 
113  static int getSpeedCategory(int kph);
114 
116  static int getSpeedCategoryUpperBound(int kph);
117 
119  static int getNavteqLaneCode(const int numLanes);
120 
122  static double getGraphLength(NBEdge* edge);
123 
124  static std::string getSinglePostalCode(const std::string& zipCode, const std::string edgeID);
125 
127  static const std::string UNDEFINED;
128 
130  static inline int speedInKph(double metersPerSecond) {
131  return (int)std::floor(metersPerSecond * 3.6 + 0.5);
132  }
133 };
134 
135 
136 #endif
137 
138 /****************************************************************************/
139 
NWWriter_DlrNavteq::getBrunnelType
static int getBrunnelType(NBEdge *edge)
get the navteq brunnel type
Definition: NWWriter_DlrNavteq.cpp:398
NWWriter_DlrNavteq::writeNetwork
static void writeNetwork(const OptionsCont &oc, NBNetBuilder &nb)
Writes the network into XML-files (nodes, edges, connections, traffic lights)
Definition: NWWriter_DlrNavteq.cpp:52
NBEdgeCont
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:60
NBNetBuilder
Instance responsible for building networks.
Definition: NBNetBuilder.h:109
NWWriter_DlrNavteq
Exporter writing networks using XML (native input) format.
Definition: NWWriter_DlrNavteq.h:53
NWWriter_DlrNavteq::writeTrafficSignals
static void writeTrafficSignals(const OptionsCont &oc, NBNodeCont &nc)
Writes the traffic_signals file.
Definition: NWWriter_DlrNavteq.cpp:449
NBTrafficLightLogicCont
A container for traffic light definitions and built programs.
Definition: NBTrafficLightLogicCont.h:57
OutputDevice
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:63
SUMOSAXHandler.h
NWWriter_DlrNavteq::getFormOfWay
static int getFormOfWay(NBEdge *edge)
get the form of way
Definition: NWWriter_DlrNavteq.cpp:411
NWWriter_DlrNavteq::speedInKph
static int speedInKph(double metersPerSecond)
get edge speed rounded to kmh
Definition: NWWriter_DlrNavteq.h:130
NBNodeCont
Container for nodes during the netbuilding process.
Definition: NBNodeCont.h:59
NWWriter_DlrNavteq::getGraphLength
static double getGraphLength(NBEdge *edge)
get the length of the edge when measured up to the junction center
Definition: NWWriter_DlrNavteq.cpp:426
NBEdge
The representation of a single edge during network building.
Definition: NBEdge.h:91
NWWriter_DlrNavteq::getSpeedCategory
static int getSpeedCategory(int kph)
get the navteq speed class based on the speed in km/h
Definition: NWWriter_DlrNavteq.cpp:336
NWWriter_DlrNavteq::getSinglePostalCode
static std::string getSinglePostalCode(const std::string &zipCode, const std::string edgeID)
Definition: NWWriter_DlrNavteq.cpp:435
SVCPermissions
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
Definition: SUMOVehicleClass.h:218
NWWriter_DlrNavteq::getAllowedTypes
static std::string getAllowedTypes(SVCPermissions permissions)
build the ascii-bit-vector for column vehicle_type
Definition: NWWriter_DlrNavteq.cpp:270
NWWriter_DlrNavteq::getNavteqLaneCode
static int getNavteqLaneCode(const int numLanes)
get the lane number encoding
Definition: NWWriter_DlrNavteq.cpp:390
UtilExceptions.h
OptionsCont
A storage for options typed value containers)
Definition: OptionsCont.h:89
NWWriter_DlrNavteq::writeConnectedLanes
static void writeConnectedLanes(const OptionsCont &oc, NBNodeCont &nc)
Writes the connected_lanes file.
Definition: NWWriter_DlrNavteq.cpp:525
NWWriter_DlrNavteq::writeHeader
static void writeHeader(OutputDevice &device, const OptionsCont &oc)
write header comments (input paramters, date, etc...)
Definition: NWWriter_DlrNavteq.cpp:66
NBTypeCont
A storage for available types of edges.
Definition: NBTypeCont.h:54
NWWriter_DlrNavteq::writeProhibitedManoeuvres
static void writeProhibitedManoeuvres(const OptionsCont &oc, const NBNodeCont &nc, const NBEdgeCont &ec)
Writes the prohibited_manoeuvres file.
Definition: NWWriter_DlrNavteq.cpp:482
NWWriter_DlrNavteq::UNDEFINED
static const std::string UNDEFINED
magic value for undefined stuff
Definition: NWWriter_DlrNavteq.h:127
NWWriter_DlrNavteq::getRoadClass
static int getRoadClass(NBEdge *edge)
get the navteq road class
Definition: NWWriter_DlrNavteq.cpp:292
config.h
NWWriter_DlrNavteq::writeNodesUnsplitted
static void writeNodesUnsplitted(const OptionsCont &oc, NBNodeCont &nc, NBEdgeCont &ec, std::map< NBEdge *, std::string > &internalNodes)
Writes the nodes_unsplitted file.
Definition: NWWriter_DlrNavteq.cpp:80
NWWriter_DlrNavteq::getSpeedCategoryUpperBound
static int getSpeedCategoryUpperBound(int kph)
get the SPEED_LIMIT as defined by elmar (upper bound of speed category)
Definition: NWWriter_DlrNavteq.cpp:363
NBNode
Represents a single node (junction) during network building.
Definition: NBNode.h:67
NWWriter_DlrNavteq::writeLinksUnsplitted
static void writeLinksUnsplitted(const OptionsCont &oc, NBEdgeCont &ec, std::map< NBEdge *, std::string > &internalNodes)
Writes the links_unsplitted file.
Definition: NWWriter_DlrNavteq.cpp:195