SUMO - Simulation of Urban MObility
NWWriter_XML.cpp
Go to the documentation of this file.
1 /****************************************************************************/
9 // Exporter writing networks using XML (native input) format
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
12 // Copyright (C) 2001-2016 DLR (http://www.dlr.de/) and contributors
13 /****************************************************************************/
14 //
15 // This file is part of SUMO.
16 // SUMO is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 /****************************************************************************/
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 #include <algorithm>
34 #include <netbuild/NBEdge.h>
35 #include <netbuild/NBEdgeCont.h>
36 #include <netbuild/NBNode.h>
37 #include <netbuild/NBNodeCont.h>
38 #include <netbuild/NBNetBuilder.h>
39 #include <utils/common/ToString.h>
44 #include "NWFrame.h"
45 #include "NWWriter_SUMO.h"
46 #include "NWWriter_XML.h"
47 
48 #ifdef CHECK_MEMORY_LEAKS
49 #include <foreign/nvwa/debug_new.h>
50 #endif // CHECK_MEMORY_LEAKS
51 
52 
53 
54 // ===========================================================================
55 // method definitions
56 // ===========================================================================
57 // ---------------------------------------------------------------------------
58 // static methods
59 // ---------------------------------------------------------------------------
60 void
62  // check whether plain-output files shall be generated
63  if (oc.isSet("plain-output-prefix")) {
64  writeNodes(oc, nb.getNodeCont());
65  if (nb.getTypeCont().size() > 0) {
66  writeTypes(oc, nb.getTypeCont());
67  }
70  }
71  if (oc.isSet("junctions.join-output")) {
73  }
74  if (oc.isSet("street-sign-output")) {
75  writeStreetSigns(oc, nb.getEdgeCont());
76  }
77 }
78 
79 
80 void
83  bool useGeo = oc.exists("proj.plain-geo") && oc.getBool("proj.plain-geo");
84  if (useGeo && !gch.usingGeoProjection()) {
85  WRITE_WARNING("Ignoring option \"proj.plain-geo\" because no geo-conversion has been defined");
86  useGeo = false;
87  }
88  const bool geoAccuracy = useGeo || gch.usingInverseGeoProjection();
89 
90  OutputDevice& device = OutputDevice::getDevice(oc.getString("plain-output-prefix") + ".nod.xml");
91  device.writeXMLHeader("nodes", NWFrame::MAJOR_VERSION + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo.dlr.de/xsd/nodes_file.xsd\"");
92 
93  // write network offsets and projection to allow reconstruction of original coordinates
94  if (!useGeo) {
96  }
97 
98  // write nodes
99  for (std::map<std::string, NBNode*>::const_iterator i = nc.begin(); i != nc.end(); ++i) {
100  NBNode* n = (*i).second;
101  device.openTag(SUMO_TAG_NODE);
102  device.writeAttr(SUMO_ATTR_ID, n->getID());
103  // write position
104  Position pos = n->getPosition();
105  if (useGeo) {
106  gch.cartesian2geo(pos);
107  }
108  if (geoAccuracy) {
110  }
111  NWFrame::writePositionLong(pos, device);
112  if (geoAccuracy) {
113  device.setPrecision();
114  }
115 
116  device.writeAttr(SUMO_ATTR_TYPE, toString(n->getType()));
117  if (n->isTLControlled()) {
118  const std::set<NBTrafficLightDefinition*>& tlss = n->getControllingTLS();
119  // set may contain multiple programs for the same id.
120  // make sure ids are unique and sorted
121  std::set<std::string> tlsIDs;
122  std::set<std::string> controlledInnerEdges;
123  for (std::set<NBTrafficLightDefinition*>::const_iterator it_tl = tlss.begin(); it_tl != tlss.end(); it_tl++) {
124  tlsIDs.insert((*it_tl)->getID());
125  std::vector<std::string> cie = (*it_tl)->getControlledInnerEdges();
126  controlledInnerEdges.insert(cie.begin(), cie.end());
127  }
128  std::vector<std::string> sortedIDs(tlsIDs.begin(), tlsIDs.end());
129  sort(sortedIDs.begin(), sortedIDs.end());
130  device.writeAttr(SUMO_ATTR_TLID, sortedIDs);
131  if (controlledInnerEdges.size() > 0) {
132  std::vector<std::string> sortedCIEs(controlledInnerEdges.begin(), controlledInnerEdges.end());
133  sort(sortedCIEs.begin(), sortedCIEs.end());
134  device.writeAttr(SUMO_ATTR_CONTROLLED_INNER, joinToString(sortedCIEs, " "));
135  }
136  }
137  if (n->hasCustomShape()) {
138  device.writeAttr(SUMO_ATTR_SHAPE, n->getShape());
139  }
141  device.writeAttr(SUMO_ATTR_RADIUS, n->getRadius());
142  }
143  if (n->getKeepClear() == false) {
144  device.writeAttr<bool>(SUMO_ATTR_KEEP_CLEAR, n->getKeepClear());
145  }
146  device.closeTag();
147  }
148  device.close();
149 }
150 
151 
152 void
154  OutputDevice& device = OutputDevice::getDevice(oc.getString("plain-output-prefix") + ".typ.xml");
155  device.writeXMLHeader("types", NWFrame::MAJOR_VERSION + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo.dlr.de/xsd/types_file.xsd\"");
156  tc.writeTypes(device);
157  device.close();
158 }
159 
160 
161 void
163  const GeoConvHelper& gch = GeoConvHelper::getFinal();
164  bool useGeo = oc.exists("proj.plain-geo") && oc.getBool("proj.plain-geo");
165  const bool geoAccuracy = useGeo || gch.usingInverseGeoProjection();
166 
167  OutputDevice& edevice = OutputDevice::getDevice(oc.getString("plain-output-prefix") + ".edg.xml");
168  edevice.writeXMLHeader("edges", NWFrame::MAJOR_VERSION + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo.dlr.de/xsd/edges_file.xsd\"");
169  OutputDevice& cdevice = OutputDevice::getDevice(oc.getString("plain-output-prefix") + ".con.xml");
170  cdevice.writeXMLHeader("connections", NWFrame::MAJOR_VERSION + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo.dlr.de/xsd/connections_file.xsd\"");
171  const bool writeNames = oc.getBool("output.street-names");
172  for (std::map<std::string, NBEdge*>::const_iterator i = ec.begin(); i != ec.end(); ++i) {
173  // write the edge itself to the edges-files
174  NBEdge* e = (*i).second;
175  edevice.openTag(SUMO_TAG_EDGE);
176  edevice.writeAttr(SUMO_ATTR_ID, e->getID());
177  edevice.writeAttr(SUMO_ATTR_FROM, e->getFromNode()->getID());
178  edevice.writeAttr(SUMO_ATTR_TO, e->getToNode()->getID());
179  if (writeNames && e->getStreetName() != "") {
181  }
183  // write the type if given
184  if (e->getTypeID() != "") {
185  edevice.writeAttr(SUMO_ATTR_TYPE, e->getTypeID());
186  }
188  if (!e->hasLaneSpecificSpeed()) {
189  edevice.writeAttr(SUMO_ATTR_SPEED, e->getSpeed());
190  }
191  // write non-default geometry
192  if (!e->hasDefaultGeometry()) {
193  PositionVector geom = e->getGeometry();
194  if (useGeo) {
195  for (int i = 0; i < (int) geom.size(); i++) {
196  gch.cartesian2geo(geom[i]);
197  }
198  }
199  if (geoAccuracy) {
201  }
202  edevice.writeAttr(SUMO_ATTR_SHAPE, geom);
203  if (geoAccuracy) {
204  edevice.setPrecision();
205  }
206  }
207  // write the spread type if not default ("right")
210  }
211  // write the length if it was specified
212  if (e->hasLoadedLength()) {
214  }
215  // some attributes can be set by edge default or per lane. Write as default if possible (efficiency)
217  edevice.writeAttr(SUMO_ATTR_WIDTH, e->getLaneWidth());
218  }
221  }
222  if (!e->hasLaneSpecificPermissions()) {
223  writePermissions(edevice, e->getPermissions(0));
224  }
225  if (e->needsLaneSpecificOutput()) {
226  for (int i = 0; i < (int)e->getLanes().size(); ++i) {
227  const NBEdge::Lane& lane = e->getLanes()[i];
228  edevice.openTag(SUMO_TAG_LANE);
229  edevice.writeAttr(SUMO_ATTR_INDEX, i);
230  // write allowed lanes
231  if (e->hasLaneSpecificPermissions()) {
232  writePermissions(edevice, lane.permissions);
233  }
234  writePreferences(edevice, lane.preferred);
235  // write other attributes
237  edevice.writeAttr(SUMO_ATTR_WIDTH, lane.width);
238  }
240  edevice.writeAttr(SUMO_ATTR_ENDOFFSET, lane.endOffset);
241  }
242  if (e->hasLaneSpecificSpeed()) {
243  edevice.writeAttr(SUMO_ATTR_SPEED, lane.speed);
244  }
245  if (lane.oppositeID != "") {
246  edevice.openTag(SUMO_TAG_NEIGH);
247  edevice.writeAttr(SUMO_ATTR_LANE, lane.oppositeID);
248  edevice.closeTag();
249  }
250  edevice.closeTag();
251  }
252  }
253  edevice.closeTag();
254  // write this edge's connections to the connections-files
256  const std::vector<NBEdge::Connection> connections = e->getConnections();
257  for (std::vector<NBEdge::Connection>::const_iterator c = connections.begin(); c != connections.end(); ++c) {
258  NWWriter_SUMO::writeConnection(cdevice, *e, *c, false, NWWriter_SUMO::PLAIN);
259  }
260  if (connections.size() > 0) {
261  cdevice << "\n";
262  }
263  }
264  // write roundabout information to the edges-files
265  if (ec.getRoundabouts().size() > 0) {
266  edevice.lf();
268  }
269 
270  // write loaded prohibitions to the connections-file
271  for (std::map<std::string, NBNode*>::const_iterator i = nc.begin(); i != nc.end(); ++i) {
272  NWWriter_SUMO::writeProhibitions(cdevice, i->second->getProhibitions());
273  }
274  // write pedestrian crossings to the connections-file
275  for (std::map<std::string, NBNode*>::const_iterator it_node = nc.begin(); it_node != nc.end(); ++it_node) {
276  const std::vector<NBNode::Crossing>& crossings = (*it_node).second->getCrossings();
277  for (std::vector<NBNode::Crossing>::const_iterator it = crossings.begin(); it != crossings.end(); it++) {
278  cdevice.openTag(SUMO_TAG_CROSSING);
279  cdevice.writeAttr(SUMO_ATTR_NODE, (*it_node).second->getID());
280  cdevice.writeAttr(SUMO_ATTR_EDGES, (*it).edges);
281  cdevice.writeAttr(SUMO_ATTR_PRIORITY, (*it).priority);
282  if ((*it).width != NBNode::DEFAULT_CROSSING_WIDTH) {
283  cdevice.writeAttr(SUMO_ATTR_WIDTH, (*it).width);
284  }
285  cdevice.closeTag();
286  }
287  }
288  // write customShapes to the connection-file
289  for (std::map<std::string, NBNode*>::const_iterator it_node = nc.begin(); it_node != nc.end(); ++it_node) {
290  NBNode::CustomShapeMap customShapes = (*it_node).second->getCustomLaneShapes();
291  for (NBNode::CustomShapeMap::const_iterator it = customShapes.begin(); it != customShapes.end(); ++it) {
292  cdevice.openTag(SUMO_TAG_CUSTOMSHAPE);
293  cdevice.writeAttr(SUMO_ATTR_ID, (*it).first);
294  cdevice.writeAttr(SUMO_ATTR_SHAPE, (*it).second);
295  cdevice.closeTag();
296  }
297  }
298 
299  edevice.close();
300  cdevice.close();
301 }
302 
303 
304 void
306  OutputDevice& device = OutputDevice::getDevice(oc.getString("plain-output-prefix") + ".tll.xml");
307  device.writeXMLHeader("tlLogics", NWFrame::MAJOR_VERSION + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo.dlr.de/xsd/tllogic_file.xsd\"");
309  // we also need to remember the associations between tlLogics and connections
310  // since the information in con.xml is insufficient
311  for (std::map<std::string, NBEdge*>::const_iterator i = ec.begin(); i != ec.end(); ++i) {
312  NBEdge* e = (*i).second;
313  // write this edge's tl-controlled connections
314  const std::vector<NBEdge::Connection> connections = e->getConnections();
315  for (std::vector<NBEdge::Connection>::const_iterator c = connections.begin(); c != connections.end(); ++c) {
316  if (c->tlID != "") {
317  NWWriter_SUMO::writeConnection(device, *e, *c, false, NWWriter_SUMO::TLL);
318  }
319  }
320  }
321  device.close();
322 }
323 
324 
325 void
327  OutputDevice& device = OutputDevice::getDevice(oc.getString("junctions.join-output"));
328  device.writeXMLHeader("nodes", NWFrame::MAJOR_VERSION + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo.dlr.de/xsd/nodes_file.xsd\"");
329  const std::vector<std::set<std::string> >& clusters = nc.getJoinedClusters();
330  for (std::vector<std::set<std::string> >::const_iterator it = clusters.begin(); it != clusters.end(); it++) {
331  assert((*it).size() > 0);
332  device.openTag(SUMO_TAG_JOIN);
333  // prepare string
334  std::ostringstream oss;
335  for (std::set<std::string>::const_iterator it_id = it->begin(); it_id != it->end(); it_id++) {
336  oss << *it_id << " ";
337  }
338  // remove final space
339  std::string ids = oss.str();
340  device.writeAttr(SUMO_ATTR_NODES, ids.substr(0, ids.size() - 1));
341  device.closeTag();
342  }
343  device.close();
344 }
345 
346 
347 void
349  OutputDevice& device = OutputDevice::getDevice(oc.getString("street-sign-output"));
350  device.writeXMLHeader("additional", "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo.dlr.de/xsd/additional_file.xsd\"");
351  for (std::map<std::string, NBEdge*>::const_iterator i = ec.begin(); i != ec.end(); ++i) {
352  NBEdge* e = (*i).second;
353  const std::vector<NBSign>& signs = e->getSigns();
354  for (std::vector<NBSign>::const_iterator it = signs.begin(); it != signs.end(); ++it) {
355  it->writeAsPOI(device, e);
356  }
357  }
358  device.close();
359 }
360 /****************************************************************************/
361 
bool getKeepClear() const
Returns the keepClear flag.
Definition: NBNode.h:278
LaneSpreadFunction getLaneSpreadFunction() const
Returns how this edge&#39;s lanes&#39; lateral offset is computed.
Definition: NBEdge.h:646
The information about how to spread the lanes from the given position.
void writePermissions(OutputDevice &into, SVCPermissions permissions)
writes allowed disallowed attributes if needed;
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
Definition: OutputDevice.h:257
void close()
Closes the device and removes it from the dictionary.
const std::vector< std::set< std::string > > & getJoinedClusters() const
gets all joined clusters (see doc for myClusters2Join)
Definition: NBNodeCont.h:313
static void writeLocation(OutputDevice &into)
writes the location element
SUMOReal endOffset
This lane&#39;s offset to the intersection begin.
Definition: NBEdge.h:141
a list of node ids, used for controlling joining
static const SUMOReal UNSPECIFIED_WIDTH
unspecified lane width
Definition: NBEdge.h:237
NBTypeCont & getTypeCont()
Returns the type container.
Definition: NBNetBuilder.h:169
SUMOReal getEndOffset() const
Returns the offset to the destination node.
Definition: NBEdge.h:530
Whether vehicles must keep the junction clear.
SUMOReal getRadius() const
Returns the turning radius of this node.
Definition: NBNode.h:272
std::map< std::string, NBNode * >::const_iterator begin() const
Returns the pointer to the begin of the stored nodes.
Definition: NBNodeCont.h:126
static void writeStreetSigns(const OptionsCont &oc, NBEdgeCont &ec)
Writes street signs as POIs to file.
std::map< std::string, NBNode * >::const_iterator end() const
Returns the pointer to the end of the stored nodes.
Definition: NBNodeCont.h:134
A container for traffic light definitions and built programs.
void writePreferences(OutputDevice &into, SVCPermissions preferred)
writes allowed disallowed attributes if needed;
int getPriority() const
Returns the priority of the edge.
Definition: NBEdge.h:402
#define GEO_OUTPUT_ACCURACY
Definition: config.h:16
const std::string & getTypeID() const
get ID of type
Definition: NBEdge.h:934
bool hasCustomShape() const
return whether the shape was set by the user
Definition: NBNode.h:520
const std::vector< NBSign > & getSigns() const
get Signs
Definition: NBEdge.h:1142
bool usingGeoProjection() const
Returns whether a transformation from geo to metric coordinates will be performed.
The representation of a single edge during network building.
Definition: NBEdge.h:71
static std::string escapeXML(const std::string &orig)
Replaces the standard escapes by their XML entities.
static void writeJoinedJunctions(const OptionsCont &oc, NBNodeCont &nc)
Writes the joined-juncionts to file.
bool hasLaneSpecificSpeed() const
whether lanes differ in speed
Definition: NBEdge.cpp:1620
static void writeProhibitions(OutputDevice &into, const NBConnectionProhibits &prohibitions)
writes the given prohibitions
void setPrecision(int precision=OUTPUT_ACCURACY)
Sets the precison or resets it to default.
bool hasLoadedLength() const
Returns whether a length was set explicitly.
Definition: NBEdge.h:482
const std::vector< NBEdge::Lane > & getLanes() const
Returns the lane definitions.
Definition: NBEdge.h:552
std::map< std::string, NBEdge * >::const_iterator end() const
Returns the pointer to the end of the stored edges.
Definition: NBEdgeCont.h:198
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
const std::string & getID() const
Returns the id.
Definition: Named.h:66
static void writeTrafficLights(OutputDevice &into, const NBTrafficLightLogicCont &tllCont)
writes the traffic light logics to the given device
static const SUMOReal UNSPECIFIED_OFFSET
unspecified lane offset
Definition: NBEdge.h:240
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:200
bool writeXMLHeader(const std::string &rootElement, const std::string &attrs="", const std::string &comment="")
Writes an XML header with optional configuration.
SUMOReal speed
The speed allowed on this lane.
Definition: NBEdge.h:132
void cartesian2geo(Position &cartesian) const
Converts the given cartesian (shifted) position to its geo (lat/long) representation.
std::map< std::string, PositionVector > CustomShapeMap
Definition: NBNode.h:82
An (internal) definition of a single lane of an edge.
Definition: NBEdge.h:124
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
SVCPermissions permissions
List of vehicle types that are allowed on this lane.
Definition: NBEdge.h:135
bool isTLControlled() const
Returns whether this node is controlled by any tls.
Definition: NBNode.h:304
The turning radius at an intersection in m.
bool hasLaneSpecificWidth() const
whether lanes differ in width
Definition: NBEdge.cpp:1631
std::map< std::string, NBEdge * >::const_iterator begin() const
Returns the pointer to the begin of the stored edges.
Definition: NBEdgeCont.h:190
static void writeNodes(const OptionsCont &oc, NBNodeCont &nc)
Writes the nodes file.
bool hasLaneSpecificEndOffset() const
whether lanes differ in offset
Definition: NBEdge.cpp:1642
static methods for processing the coordinates conversion for the current net
Definition: GeoConvHelper.h:60
the edges of a route
SVCPermissions preferred
List of vehicle types that are preferred on this lane.
Definition: NBEdge.h:138
int getNumLanes() const
Returns the number of lanes.
Definition: NBEdge.h:395
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
NBEdgeCont & getEdgeCont()
Returns the edge container.
Definition: NBNetBuilder.h:153
A list of positions.
static void writeTrafficLights(const OptionsCont &oc, NBTrafficLightLogicCont &tc, NBEdgeCont &ec)
Writes the traffic lights file.
bool needsLaneSpecificOutput() const
whether at least one lane has values differing from the edges values
Definition: NBEdge.cpp:1653
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
bool hasDefaultGeometry() const
Returns whether the geometry consists only of the node positions.
Definition: NBEdge.cpp:480
bool exists(const std::string &name) const
Returns the information whether the named option is known.
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:66
const std::string & getStreetName() const
Returns the street name of this edge.
Definition: NBEdge.h:518
static void writeNetwork(const OptionsCont &oc, NBNetBuilder &nb)
Writes the network into XML-files (nodes, edges, connections, traffic lights)
const std::set< EdgeSet > getRoundabouts() const
Returns the determined roundabouts.
Definition: NBEdgeCont.cpp:988
static void writePositionLong(const Position &pos, OutputDevice &dev)
Writes the given position to device in long format (one attribute per dimension)
Definition: NWFrame.cpp:157
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
Definition: ToString.h:55
static void writeTypes(const OptionsCont &oc, NBTypeCont &tc)
Writes the types file.
SVCPermissions getPermissions(int lane=-1) const
get the union of allowed classes over all lanes or for a specific lane
Definition: NBEdge.cpp:2726
bool hasLaneSpecificPermissions() const
whether lanes differ in allowed vehicle classes
Definition: NBEdge.cpp:1606
const PositionVector & getShape() const
retrieve the junction shape
Definition: NBNode.cpp:1722
const PositionVector & getGeometry() const
Returns the geometry of the edge.
Definition: NBEdge.h:577
std::string oppositeID
An opposite lane ID, if given.
Definition: NBEdge.h:150
static void writeEdgesAndConnections(const OptionsCont &oc, NBNodeCont &nc, NBEdgeCont &ec)
Writes the edges and connections files.
const std::vector< Connection > & getConnections() const
Returns the connections.
Definition: NBEdge.h:803
NBNodeCont & getNodeCont()
Returns the node container.
Definition: NBNetBuilder.h:161
Instance responsible for building networks.
Definition: NBNetBuilder.h:112
static OutputDevice & getDevice(const std::string &name)
Returns the described OutputDevice.
const std::set< NBTrafficLightDefinition * > & getControllingTLS() const
Returns the traffic lights that were assigned to this node.
Definition: NBNode.h:318
A storage for options typed value containers)
Definition: OptionsCont.h:99
static const SUMOReal DEFAULT_CROSSING_WIDTH
default width of pedetrian crossings
Definition: NBNode.h:186
SumoXMLNodeType getType() const
Returns the type of this node.
Definition: NBNode.h:265
void sortOutgoingConnectionsByIndex()
sorts the outgoing connections by their from-lane-index and their to-lane-index
Definition: NBEdge.cpp:1041
NBTrafficLightLogicCont & getTLLogicCont()
Returns the traffic light logics container.
Definition: NBNetBuilder.h:177
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
bool usingInverseGeoProjection() const
Returns the information whether an inverse transformation will happen.
SUMOReal getSpeed() const
Returns the speed allowed on this edge.
Definition: NBEdge.h:489
const Position & getPosition() const
Returns the position of this node.
Definition: NBNode.h:228
Represents a single node (junction) during network building.
Definition: NBNode.h:74
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=OUTPUT_ACCURACY)
Definition: ToString.h:188
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
bool closeTag()
Closes the most recently opened tag.
static const SUMOReal UNSPECIFIED_RADIUS
unspecified lane width
Definition: NBNode.h:189
NBNode * getFromNode() const
Returns the origin node of the edge.
Definition: NBEdge.h:409
Container for nodes during the netbuilding process.
Definition: NBNodeCont.h:63
SUMOReal getLoadedLength() const
Returns the length was set explicitly or the computed length if it wasn&#39;t set.
Definition: NBEdge.h:472
SUMOReal getLaneWidth() const
Returns the default width of lanes of this edge.
Definition: NBEdge.h:505
static const std::string MAJOR_VERSION
The version number for written files.
Definition: NWFrame.h:69
int size() const
Returns the number of known types.
Definition: NBTypeCont.h:104
static void writeRoundabouts(OutputDevice &into, const std::set< EdgeSet > &roundabouts, const NBEdgeCont &ec)
Writes roundabouts.
NBNode * getToNode() const
Returns the destination node of the edge.
Definition: NBEdge.h:416
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
void lf()
writes a line feed if applicable
Definition: OutputDevice.h:235
SUMOReal width
This lane&#39;s width.
Definition: NBEdge.h:144
static void writeConnection(OutputDevice &into, const NBEdge &from, const NBEdge::Connection &c, bool includeInternal, ConnectionStyle style=SUMONET)
Writes connections outgoing from the given edge (also used in NWWriter_XML)
A storage for available types of edges.
Definition: NBTypeCont.h:62
void writeTypes(OutputDevice &into) const
writes all types a s XML
Definition: NBTypeCont.cpp:131