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 /****************************************************************************/
16 // Exporter writing networks using DlrNavteq (Elmar) format
17 /****************************************************************************/
18 #ifndef NWWriter_DlrNavteq_h
19 #define NWWriter_DlrNavteq_h
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
27 #include <string>
28 #include <map>
31 
32 
33 // ===========================================================================
34 // class declarations
35 // ===========================================================================
36 class NBEdge;
37 class NBEdgeCont;
38 class NBNetBuilder;
39 class NBNode;
40 class NBNodeCont;
42 class NBTypeCont;
43 class OptionsCont;
44 
45 
46 // ===========================================================================
47 // class definitions
48 // ===========================================================================
55 public:
61  static void writeNetwork(const OptionsCont& oc, NBNetBuilder& nb);
62 
64  static int getRoadClass(NBEdge* edge);
65 
67  static int getBrunnelType(NBEdge* edge);
68 
70  static int getFormOfWay(NBEdge* edge);
71 
72 private:
79  static void writeNodesUnsplitted(const OptionsCont& oc, NBNodeCont& nc, NBEdgeCont& ec, std::map<NBEdge*, std::string>& internalNodes);
80 
86  static void writeLinksUnsplitted(const OptionsCont& oc, NBEdgeCont& ec, std::map<NBEdge*, std::string>& internalNodes);
87 
92  static void writeTrafficSignals(const OptionsCont& oc, NBNodeCont& nc);
93 
94 
99  static void writeProhibitedManoeuvres(const OptionsCont& oc, const NBNodeCont& nc, const NBEdgeCont& ec);
100 
105  static void writeConnectedLanes(const OptionsCont& oc, NBNodeCont& nc);
106 
108  static void writeHeader(OutputDevice& device, const OptionsCont& oc);
109 
111  static std::string getAllowedTypes(SVCPermissions permissions);
112 
114  static int getSpeedCategory(int kph);
115 
117  static int getSpeedCategoryUpperBound(int kph);
118 
120  static int getNavteqLaneCode(const int numLanes);
121 
123  static double getGraphLength(NBEdge* edge);
124 
125  static std::string getSinglePostalCode(const std::string& zipCode, const std::string edgeID);
126 
128  static const std::string UNDEFINED;
129 
131  static inline int speedInKph(double metersPerSecond) {
132  return (int)std::floor(metersPerSecond * 3.6 + 0.5);
133  }
134 };
135 
136 
137 #endif
138 
139 /****************************************************************************/
140 
NWWriter_DlrNavteq::getBrunnelType
static int getBrunnelType(NBEdge *edge)
get the navteq brunnel type
Definition: NWWriter_DlrNavteq.cpp:391
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:53
NBEdgeCont
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:61
NBNetBuilder
Instance responsible for building networks.
Definition: NBNetBuilder.h:110
NWWriter_DlrNavteq
Exporter writing networks using XML (native input) format.
Definition: NWWriter_DlrNavteq.h:54
NWWriter_DlrNavteq::writeTrafficSignals
static void writeTrafficSignals(const OptionsCont &oc, NBNodeCont &nc)
Writes the traffic_signals file.
Definition: NWWriter_DlrNavteq.cpp:442
NBTrafficLightLogicCont
A container for traffic light definitions and built programs.
Definition: NBTrafficLightLogicCont.h:58
OutputDevice
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:64
SUMOSAXHandler.h
NWWriter_DlrNavteq::getFormOfWay
static int getFormOfWay(NBEdge *edge)
get the form of way
Definition: NWWriter_DlrNavteq.cpp:404
NWWriter_DlrNavteq::speedInKph
static int speedInKph(double metersPerSecond)
get edge speed rounded to kmh
Definition: NWWriter_DlrNavteq.h:131
NBNodeCont
Container for nodes during the netbuilding process.
Definition: NBNodeCont.h:60
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:419
NBEdge
The representation of a single edge during network building.
Definition: NBEdge.h:86
NWWriter_DlrNavteq::getSpeedCategory
static int getSpeedCategory(int kph)
get the navteq speed class based on the speed in km/h
Definition: NWWriter_DlrNavteq.cpp:329
NWWriter_DlrNavteq::getSinglePostalCode
static std::string getSinglePostalCode(const std::string &zipCode, const std::string edgeID)
Definition: NWWriter_DlrNavteq.cpp:428
SVCPermissions
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
Definition: SUMOVehicleClass.h:219
NWWriter_DlrNavteq::getAllowedTypes
static std::string getAllowedTypes(SVCPermissions permissions)
build the ascii-bit-vector for column vehicle_type
Definition: NWWriter_DlrNavteq.cpp:263
NWWriter_DlrNavteq::getNavteqLaneCode
static int getNavteqLaneCode(const int numLanes)
get the lane number encoding
Definition: NWWriter_DlrNavteq.cpp:383
UtilExceptions.h
OptionsCont
A storage for options typed value containers)
Definition: OptionsCont.h:90
NWWriter_DlrNavteq::writeConnectedLanes
static void writeConnectedLanes(const OptionsCont &oc, NBNodeCont &nc)
Writes the connected_lanes file.
Definition: NWWriter_DlrNavteq.cpp:518
NWWriter_DlrNavteq::writeHeader
static void writeHeader(OutputDevice &device, const OptionsCont &oc)
write header comments (input paramters, date, etc...)
Definition: NWWriter_DlrNavteq.cpp:67
NBTypeCont
A storage for available types of edges.
Definition: NBTypeCont.h:55
NWWriter_DlrNavteq::writeProhibitedManoeuvres
static void writeProhibitedManoeuvres(const OptionsCont &oc, const NBNodeCont &nc, const NBEdgeCont &ec)
Writes the prohibited_manoeuvres file.
Definition: NWWriter_DlrNavteq.cpp:475
NWWriter_DlrNavteq::UNDEFINED
static const std::string UNDEFINED
magic value for undefined stuff
Definition: NWWriter_DlrNavteq.h:128
NWWriter_DlrNavteq::getRoadClass
static int getRoadClass(NBEdge *edge)
get the navteq road class
Definition: NWWriter_DlrNavteq.cpp:285
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:81
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:356
NBNode
Represents a single node (junction) during network building.
Definition: NBNode.h:68
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:196