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-2017 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 
49 
50 // ===========================================================================
51 // method definitions
52 // ===========================================================================
53 // ---------------------------------------------------------------------------
54 // static methods
55 // ---------------------------------------------------------------------------
56 void
58  // check whether plain-output files shall be generated
59  if (oc.isSet("plain-output-prefix")) {
60  writeNodes(oc, nb.getNodeCont());
61  if (nb.getTypeCont().size() > 0) {
62  writeTypes(oc, nb.getTypeCont());
63  }
66  }
67  if (oc.isSet("junctions.join-output")) {
69  }
70  if (oc.isSet("street-sign-output")) {
71  writeStreetSigns(oc, nb.getEdgeCont());
72  }
73  if (oc.exists("ptstop-output") && oc.isSet("ptstop-output")) {
74  writePTStops(oc, nb.getPTStopCont());
75  }
76 }
77 
78 
79 void
82  bool useGeo = oc.exists("proj.plain-geo") && oc.getBool("proj.plain-geo");
83  if (useGeo && !gch.usingGeoProjection()) {
84  WRITE_WARNING("Ignoring option \"proj.plain-geo\" because no geo-conversion has been defined");
85  useGeo = false;
86  }
87  const bool geoAccuracy = useGeo || gch.usingInverseGeoProjection();
88 
89  OutputDevice& device = OutputDevice::getDevice(oc.getString("plain-output-prefix") + ".nod.xml");
90  std::map<SumoXMLAttr, std::string> attrs;
92  device.writeXMLHeader("nodes", "nodes_file.xsd", attrs);
93 
94  // write network offsets and projection to allow reconstruction of original coordinates
95  if (!useGeo) {
97  }
98 
99  // write nodes
100  for (std::map<std::string, NBNode*>::const_iterator i = nc.begin(); i != nc.end(); ++i) {
101  NBNode* n = (*i).second;
102  device.openTag(SUMO_TAG_NODE);
103  device.writeAttr(SUMO_ATTR_ID, n->getID());
104  // write position
105  Position pos = n->getPosition();
106  if (useGeo) {
107  gch.cartesian2geo(pos);
108  }
109  if (geoAccuracy) {
110  device.setPrecision(gPrecisionGeo);
111  }
112  NWFrame::writePositionLong(pos, device);
113  if (geoAccuracy) {
114  device.setPrecision();
115  }
116 
117  device.writeAttr(SUMO_ATTR_TYPE, toString(n->getType()));
118  if (n->isTLControlled()) {
119  const std::set<NBTrafficLightDefinition*>& tlss = n->getControllingTLS();
120  // set may contain multiple programs for the same id.
121  // make sure ids are unique and sorted
122  std::set<std::string> tlsIDs;
123  std::set<std::string> controlledInnerEdges;
124  for (std::set<NBTrafficLightDefinition*>::const_iterator it_tl = tlss.begin(); it_tl != tlss.end(); it_tl++) {
125  tlsIDs.insert((*it_tl)->getID());
126  std::vector<std::string> cie = (*it_tl)->getControlledInnerEdges();
127  controlledInnerEdges.insert(cie.begin(), cie.end());
128  }
129  std::vector<std::string> sortedIDs(tlsIDs.begin(), tlsIDs.end());
130  sort(sortedIDs.begin(), sortedIDs.end());
131  device.writeAttr(SUMO_ATTR_TLID, sortedIDs);
132  if (controlledInnerEdges.size() > 0) {
133  std::vector<std::string> sortedCIEs(controlledInnerEdges.begin(), controlledInnerEdges.end());
134  sort(sortedCIEs.begin(), sortedCIEs.end());
135  device.writeAttr(SUMO_ATTR_CONTROLLED_INNER, joinToString(sortedCIEs, " "));
136  }
137  }
138  if (n->hasCustomShape()) {
139  device.writeAttr(SUMO_ATTR_SHAPE, n->getShape());
140  }
142  device.writeAttr(SUMO_ATTR_RADIUS, n->getRadius());
143  }
144  if (n->getKeepClear() == false) {
145  device.writeAttr<bool>(SUMO_ATTR_KEEP_CLEAR, n->getKeepClear());
146  }
147  device.closeTag();
148  }
149  device.close();
150 }
151 
152 
153 void
155  OutputDevice& device = OutputDevice::getDevice(oc.getString("plain-output-prefix") + ".typ.xml");
156  std::map<SumoXMLAttr, std::string> attrs;
158  device.writeXMLHeader("types", "types_file.xsd", attrs);
159  tc.writeTypes(device);
160  device.close();
161 }
162 
163 
164 void
166  const GeoConvHelper& gch = GeoConvHelper::getFinal();
167  bool useGeo = oc.exists("proj.plain-geo") && oc.getBool("proj.plain-geo");
168  const bool geoAccuracy = useGeo || gch.usingInverseGeoProjection();
169 
170  std::map<SumoXMLAttr, std::string> attrs;
172  OutputDevice& edevice = OutputDevice::getDevice(oc.getString("plain-output-prefix") + ".edg.xml");
173  edevice.writeXMLHeader("edges", "edges_file.xsd", attrs);
174  OutputDevice& cdevice = OutputDevice::getDevice(oc.getString("plain-output-prefix") + ".con.xml");
175  cdevice.writeXMLHeader("connections", "connections_file.xsd", attrs);
176  const bool writeNames = oc.getBool("output.street-names");
177  for (std::map<std::string, NBEdge*>::const_iterator i = ec.begin(); i != ec.end(); ++i) {
178  // write the edge itself to the edges-files
179  NBEdge* e = (*i).second;
180  edevice.openTag(SUMO_TAG_EDGE);
181  edevice.writeAttr(SUMO_ATTR_ID, e->getID());
182  edevice.writeAttr(SUMO_ATTR_FROM, e->getFromNode()->getID());
183  edevice.writeAttr(SUMO_ATTR_TO, e->getToNode()->getID());
184  if (writeNames && e->getStreetName() != "") {
186  }
188  // write the type if given
189  if (e->getTypeID() != "") {
190  edevice.writeAttr(SUMO_ATTR_TYPE, e->getTypeID());
191  }
193  if (!e->hasLaneSpecificSpeed()) {
194  edevice.writeAttr(SUMO_ATTR_SPEED, e->getSpeed());
195  }
196  // write non-default geometry
197  if (!e->hasDefaultGeometry()) {
198  PositionVector geom = e->getGeometry();
199  if (useGeo) {
200  for (int i = 0; i < (int) geom.size(); i++) {
201  gch.cartesian2geo(geom[i]);
202  }
203  }
204  if (geoAccuracy) {
205  edevice.setPrecision(gPrecisionGeo);
206  }
207  edevice.writeAttr(SUMO_ATTR_SHAPE, geom);
208  if (geoAccuracy) {
209  edevice.setPrecision();
210  }
211  }
212  // write the spread type if not default ("right")
215  }
216  // write the length if it was specified
217  if (e->hasLoadedLength()) {
219  }
220  // some attributes can be set by edge default or per lane. Write as default if possible (efficiency)
222  edevice.writeAttr(SUMO_ATTR_WIDTH, e->getLaneWidth());
223  }
226  }
227  if (!e->hasLaneSpecificPermissions()) {
228  writePermissions(edevice, e->getPermissions(0));
229  }
230  if (e->needsLaneSpecificOutput()) {
231  for (int i = 0; i < (int)e->getLanes().size(); ++i) {
232  const NBEdge::Lane& lane = e->getLanes()[i];
233  edevice.openTag(SUMO_TAG_LANE);
234  edevice.writeAttr(SUMO_ATTR_INDEX, i);
235  // write allowed lanes
236  if (e->hasLaneSpecificPermissions()) {
237  writePermissions(edevice, lane.permissions);
238  }
239  writePreferences(edevice, lane.preferred);
240  // write other attributes
242  edevice.writeAttr(SUMO_ATTR_WIDTH, lane.width);
243  }
245  edevice.writeAttr(SUMO_ATTR_ENDOFFSET, lane.endOffset);
246  }
247  if (e->hasLaneSpecificSpeed()) {
248  edevice.writeAttr(SUMO_ATTR_SPEED, lane.speed);
249  }
250  if (lane.accelRamp) {
252  }
253  if (lane.oppositeID != "") {
254  edevice.openTag(SUMO_TAG_NEIGH);
255  edevice.writeAttr(SUMO_ATTR_LANE, lane.oppositeID);
256  edevice.closeTag();
257  }
258  edevice.closeTag();
259  }
260  }
261  edevice.closeTag();
262  // write this edge's connections to the connections-files
263  const std::vector<NBEdge::Connection> connections = e->getConnections();
264  for (std::vector<NBEdge::Connection>::const_iterator c = connections.begin(); c != connections.end(); ++c) {
265  NWWriter_SUMO::writeConnection(cdevice, *e, *c, false, NWWriter_SUMO::PLAIN);
266  }
267  if (connections.size() > 0) {
268  cdevice << "\n";
269  }
270  }
271  // write roundabout information to the edges-files
272  if (ec.getRoundabouts().size() > 0) {
273  edevice.lf();
275  }
276 
277  // write loaded prohibitions to the connections-file
278  for (std::map<std::string, NBNode*>::const_iterator i = nc.begin(); i != nc.end(); ++i) {
279  NWWriter_SUMO::writeProhibitions(cdevice, i->second->getProhibitions());
280  }
281  // write pedestrian crossings to the connections-file
282  for (std::map<std::string, NBNode*>::const_iterator it_node = nc.begin(); it_node != nc.end(); ++it_node) {
283  const std::vector<NBNode::Crossing>& crossings = (*it_node).second->getCrossings();
284  for (std::vector<NBNode::Crossing>::const_iterator it = crossings.begin(); it != crossings.end(); it++) {
285  cdevice.openTag(SUMO_TAG_CROSSING);
286  cdevice.writeAttr(SUMO_ATTR_NODE, (*it_node).second->getID());
287  cdevice.writeAttr(SUMO_ATTR_EDGES, (*it).edges);
288  cdevice.writeAttr(SUMO_ATTR_PRIORITY, (*it).priority);
289  if ((*it).width != NBNode::DEFAULT_CROSSING_WIDTH) {
290  cdevice.writeAttr(SUMO_ATTR_WIDTH, (*it).width);
291  }
292  cdevice.closeTag();
293  }
294  }
295  // write customShapes to the connection-file
296  for (std::map<std::string, NBNode*>::const_iterator it_node = nc.begin(); it_node != nc.end(); ++it_node) {
297  NBNode::CustomShapeMap customShapes = (*it_node).second->getCustomLaneShapes();
298  for (NBNode::CustomShapeMap::const_iterator it = customShapes.begin(); it != customShapes.end(); ++it) {
299  cdevice.openTag(SUMO_TAG_CUSTOMSHAPE);
300  cdevice.writeAttr(SUMO_ATTR_ID, (*it).first);
301  cdevice.writeAttr(SUMO_ATTR_SHAPE, (*it).second);
302  cdevice.closeTag();
303  }
304  }
305 
306  edevice.close();
307  cdevice.close();
308 }
309 
310 
311 void
313  std::map<SumoXMLAttr, std::string> attrs;
315  OutputDevice& device = OutputDevice::getDevice(oc.getString("plain-output-prefix") + ".tll.xml");
316  device.writeXMLHeader("tlLogics", "tllogic_file.xsd", attrs);
318  // we also need to remember the associations between tlLogics and connections
319  // since the information in con.xml is insufficient
320  for (std::map<std::string, NBEdge*>::const_iterator i = ec.begin(); i != ec.end(); ++i) {
321  NBEdge* e = (*i).second;
322  // write this edge's tl-controlled connections
323  const std::vector<NBEdge::Connection> connections = e->getConnections();
324  for (std::vector<NBEdge::Connection>::const_iterator c = connections.begin(); c != connections.end(); ++c) {
325  if (c->tlID != "") {
326  NWWriter_SUMO::writeConnection(device, *e, *c, false, NWWriter_SUMO::TLL);
327  }
328  }
329  }
330  device.close();
331 }
332 
333 
334 void
336  std::map<SumoXMLAttr, std::string> attrs;
338  OutputDevice& device = OutputDevice::getDevice(oc.getString("junctions.join-output"));
339  device.writeXMLHeader("nodes", "nodes_file.xsd", attrs);
340  const std::vector<std::set<std::string> >& clusters = nc.getJoinedClusters();
341  for (std::vector<std::set<std::string> >::const_iterator it = clusters.begin(); it != clusters.end(); it++) {
342  assert((*it).size() > 0);
343  device.openTag(SUMO_TAG_JOIN);
344  // prepare string
345  std::ostringstream oss;
346  for (std::set<std::string>::const_iterator it_id = it->begin(); it_id != it->end(); it_id++) {
347  oss << *it_id << " ";
348  }
349  // remove final space
350  std::string ids = oss.str();
351  device.writeAttr(SUMO_ATTR_NODES, ids.substr(0, ids.size() - 1));
352  device.closeTag();
353  }
354  device.close();
355 }
356 
357 
358 void
360  OutputDevice& device = OutputDevice::getDevice(oc.getString("street-sign-output"));
361  device.writeXMLHeader("additional", "additional_file.xsd");
362  for (std::map<std::string, NBEdge*>::const_iterator i = ec.begin(); i != ec.end(); ++i) {
363  NBEdge* e = (*i).second;
364  const std::vector<NBSign>& signs = e->getSigns();
365  for (std::vector<NBSign>::const_iterator it = signs.begin(); it != signs.end(); ++it) {
366  it->writeAsPOI(device, e);
367  }
368  }
369  device.close();
370 }
371 void
373  OutputDevice& device = OutputDevice::getDevice(oc.getString("ptstop-output"));
374  device.writeXMLHeader("additional", "additional_file.xsd");
375  for (std::map<std::string, NBPTStop*>::const_iterator i = sc.begin(); i != sc.end(); ++i) {
376  i->second->write(device);
377  }
378  device.close();
379 }
380 
381 
382 /****************************************************************************/
383 
384 
385 /****************************************************************************/
bool getKeepClear() const
Returns the keepClear flag.
Definition: NBNode.h:267
LaneSpreadFunction getLaneSpreadFunction() const
Returns how this edge&#39;s lanes&#39; lateral offset is computed.
Definition: NBEdge.h:677
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:256
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:267
static void writeLocation(OutputDevice &into)
writes the location element
a list of node ids, used for controlling joining
NBTypeCont & getTypeCont()
Returns a reference to the type container.
Definition: NBNetBuilder.h:165
Whether vehicles must keep the junction clear.
std::map< std::string, NBNode * >::const_iterator begin() const
Returns the pointer to the begin of the stored nodes.
Definition: NBNodeCont.h:114
static void writeStreetSigns(const OptionsCont &oc, NBEdgeCont &ec)
Writes street signs as POIs to file.
begin/end of the description of a single lane
std::map< std::string, NBNode * >::const_iterator end() const
Returns the pointer to the end of the stored nodes.
Definition: NBNodeCont.h:119
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:420
const std::string & getTypeID() const
get ID of type
Definition: NBEdge.h:971
bool hasCustomShape() const
return whether the shape was set by the user
Definition: NBNode.h:493
const std::vector< NBSign > & getSigns() const
get Signs
Definition: NBEdge.h:1181
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 const double DEFAULT_CROSSING_WIDTH
default width of pedetrian crossings
Definition: NBNode.h:197
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:1756
static void writeProhibitions(OutputDevice &into, const NBConnectionProhibits &prohibitions)
writes the given prohibitions
static const double UNSPECIFIED_RADIUS
unspecified lane width
Definition: NBNode.h:200
static const double UNSPECIFIED_OFFSET
unspecified lane offset
Definition: NBEdge.h:258
link,node: the traffic light id responsible for this link
void setPrecision(int precision=gPrecision)
Sets the precison or resets it to default.
bool hasLoadedLength() const
Returns whether a length was set explicitly.
Definition: NBEdge.h:500
NBPTStopCont & getPTStopCont()
Returns a reference to the pt stop container.
Definition: NBNetBuilder.h:181
const std::vector< NBEdge::Lane > & getLanes() const
Returns the lane definitions.
Definition: NBEdge.h:570
double endOffset
This lane&#39;s offset to the intersection begin.
Definition: NBEdge.h:141
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 double UNSPECIFIED_WIDTH
unspecified lane width
Definition: NBEdge.h:255
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:200
bool accelRamp
Whether this lane is an acceleration lane.
Definition: NBEdge.h:153
void cartesian2geo(Position &cartesian) const
Converts the given cartesian (shifted) position to its geo (lat/long) representation.
std::map< std::string, PositionVector > CustomShapeMap
map for custon shapes
Definition: NBNode.h:85
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:288
The turning radius at an intersection in m.
std::map< std::string, NBPTStop * >::const_iterator begin() const
Returns the pointer to the begin of the stored pt stops.
Definition: NBPTStopCont.h:48
bool hasLaneSpecificWidth() const
whether lanes differ in width
Definition: NBEdge.cpp:1767
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:1778
static methods for processing the coordinates conversion for the current net
Definition: GeoConvHelper.h:60
the edges of a route
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:56
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:413
bool writeXMLHeader(const std::string &rootElement, const std::string &schemaFile, std::map< SumoXMLAttr, std::string > attrs=std::map< SumoXMLAttr, std::string >())
Writes an XML header with optional configuration.
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
int gPrecisionGeo
Definition: StdDefs.cpp:31
NBEdgeCont & getEdgeCont()
Definition: NBNetBuilder.h:155
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:1799
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:488
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:536
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.
edge: the shape in xml-definition
static void writePositionLong(const Position &pos, OutputDevice &dev)
Writes the given position to device in long format (one attribute per dimension)
Definition: NWFrame.cpp:168
double getEndOffset() const
Returns the offset to the destination node.
Definition: NBEdge.h:548
begin/end of the description of a neighboring lane
static void writeTypes(const OptionsCont &oc, NBTypeCont &tc)
Writes the types file.
static std::string escapeXML(const std::string &orig, const bool maskDoubleHyphen=false)
Replaces the standard escapes by their XML entities.
std::map< std::string, NBPTStop * >::const_iterator end() const
Returns the pointer to the end of the stored pt stops.
Definition: NBPTStopCont.h:56
double speed
The speed allowed on this lane.
Definition: NBEdge.h:132
double width
This lane&#39;s width.
Definition: NBEdge.h:144
SVCPermissions getPermissions(int lane=-1) const
get the union of allowed classes over all lanes or for a specific lane
Definition: NBEdge.cpp:2913
bool hasLaneSpecificPermissions() const
whether lanes differ in allowed vehicle classes
Definition: NBEdge.cpp:1742
static void writePTStops(const OptionsCont &oc, NBPTStopCont &ec)
Writes the pt stops file.
begin/end of the description of an edge
const PositionVector & getShape() const
retrieve the junction shape
Definition: NBNode.cpp:1716
double getSpeed() const
Returns the speed allowed on this edge.
Definition: NBEdge.h:507
const PositionVector & getGeometry() const
Returns the geometry of the edge.
Definition: NBEdge.h:595
double getLaneWidth() const
Returns the default width of lanes of this edge.
Definition: NBEdge.h:523
double getRadius() const
Returns the turning radius of this node.
Definition: NBNode.h:262
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:834
NBNodeCont & getNodeCont()
Returns a reference to the node container.
Definition: NBNetBuilder.h:160
Instance responsible for building networks.
Definition: NBNetBuilder.h:114
Custom shape for an element.
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 (The set of tls that control this node) ...
Definition: NBNode.h:298
Join operation.
alternative definition for junction
A storage for options typed value containers)
Definition: OptionsCont.h:99
SumoXMLNodeType getType() const
Returns the type of this node.
Definition: NBNode.h:257
NBTrafficLightLogicCont & getTLLogicCont()
Returns a reference to the traffic light logics container.
Definition: NBNetBuilder.h:170
crossing between edges for pedestrians
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.
const Position & getPosition() const
Definition: NBNode.h:232
Represents a single node (junction) during network building.
Definition: NBNode.h:75
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
bool closeTag()
Closes the most recently opened tag.
NBNode * getFromNode() const
Returns the origin node of the edge.
Definition: NBEdge.h:427
Container for nodes during the netbuilding process.
Definition: NBNodeCont.h:63
double getLoadedLength() const
Returns the length was set explicitly or the computed length if it wasn&#39;t set.
Definition: NBEdge.h:490
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:434
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
Definition: ToString.h:228
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
void lf()
writes a line feed if applicable
Definition: OutputDevice.h:234
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:127