SUMO - Simulation of Urban MObility
NWWriter_XML.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
19 // Exporter writing networks using XML (native input) format
20 /****************************************************************************/
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #ifdef _MSC_VER
27 #include <windows_config.h>
28 #else
29 #include <config.h>
30 #endif
31 #include <algorithm>
33 #include <netbuild/NBEdge.h>
34 #include <netbuild/NBEdgeCont.h>
35 #include <netbuild/NBNode.h>
36 #include <netbuild/NBNodeCont.h>
37 #include <netbuild/NBNetBuilder.h>
38 #include <netbuild/NBPTLineCont.h>
39 #include <netbuild/NBParking.h>
40 #include <utils/common/ToString.h>
45 #include "NWFrame.h"
46 #include "NWWriter_SUMO.h"
47 #include "NWWriter_XML.h"
48 
49 
50 
51 // ===========================================================================
52 // method definitions
53 // ===========================================================================
54 // ---------------------------------------------------------------------------
55 // static methods
56 // ---------------------------------------------------------------------------
57 void
59  // check whether plain-output files shall be generated
60  if (oc.isSet("plain-output-prefix")) {
61  writeNodes(oc, nb.getNodeCont());
62  if (nb.getTypeCont().size() > 0) {
63  writeTypes(oc, nb.getTypeCont());
64  }
67  }
68  if (oc.isSet("junctions.join-output")) {
70  }
71  if (oc.isSet("street-sign-output")) {
72  writeStreetSigns(oc, nb.getEdgeCont());
73  }
74  if (oc.exists("ptstop-output") && oc.isSet("ptstop-output")) {
75  writePTStops(oc, nb.getPTStopCont());
76  }
77  if (oc.exists("ptline-output") && oc.isSet("ptline-output")) {
78  writePTLines(oc, nb.getPTLineCont(), nb.getEdgeCont());
79  }
80 
81  if (oc.exists("parking-output") && oc.isSet("parking-output")) {
83  }
84 }
85 
86 
87 void
90  bool useGeo = oc.exists("proj.plain-geo") && oc.getBool("proj.plain-geo");
91  if (useGeo && !gch.usingGeoProjection()) {
92  WRITE_WARNING("Ignoring option \"proj.plain-geo\" because no geo-conversion has been defined");
93  useGeo = false;
94  }
95  const bool geoAccuracy = useGeo || gch.usingInverseGeoProjection();
96 
97  OutputDevice& device = OutputDevice::getDevice(oc.getString("plain-output-prefix") + ".nod.xml");
98  std::map<SumoXMLAttr, std::string> attrs;
100  device.writeXMLHeader("nodes", "nodes_file.xsd", attrs);
101 
102  // write network offsets and projection to allow reconstruction of original coordinates
103  if (!useGeo) {
105  }
106 
107  // write nodes
108  for (std::map<std::string, NBNode*>::const_iterator i = nc.begin(); i != nc.end(); ++i) {
109  NBNode* n = (*i).second;
110  device.openTag(SUMO_TAG_NODE);
111  device.writeAttr(SUMO_ATTR_ID, n->getID());
112  // write position
113  Position pos = n->getPosition();
114  if (useGeo) {
115  gch.cartesian2geo(pos);
116  }
117  if (geoAccuracy) {
118  device.setPrecision(gPrecisionGeo);
119  }
120  NWFrame::writePositionLong(pos, device);
121  if (geoAccuracy) {
122  device.setPrecision();
123  }
124 
125  device.writeAttr(SUMO_ATTR_TYPE, toString(n->getType()));
126  if (n->isTLControlled()) {
127  const std::set<NBTrafficLightDefinition*>& tlss = n->getControllingTLS();
128  // set may contain multiple programs for the same id.
129  // make sure ids are unique and sorted
130  std::set<std::string> tlsIDs;
131  std::set<std::string> controlledInnerEdges;
132  for (std::set<NBTrafficLightDefinition*>::const_iterator it_tl = tlss.begin(); it_tl != tlss.end(); it_tl++) {
133  tlsIDs.insert((*it_tl)->getID());
134  std::vector<std::string> cie = (*it_tl)->getControlledInnerEdges();
135  controlledInnerEdges.insert(cie.begin(), cie.end());
136  }
137  std::vector<std::string> sortedIDs(tlsIDs.begin(), tlsIDs.end());
138  sort(sortedIDs.begin(), sortedIDs.end());
139  device.writeAttr(SUMO_ATTR_TLID, sortedIDs);
140  if (controlledInnerEdges.size() > 0) {
141  std::vector<std::string> sortedCIEs(controlledInnerEdges.begin(), controlledInnerEdges.end());
142  sort(sortedCIEs.begin(), sortedCIEs.end());
143  device.writeAttr(SUMO_ATTR_CONTROLLED_INNER, joinToString(sortedCIEs, " "));
144  }
145  }
146  if (n->hasCustomShape()) {
147  device.writeAttr(SUMO_ATTR_SHAPE, n->getShape());
148  }
150  device.writeAttr(SUMO_ATTR_RADIUS, n->getRadius());
151  }
152  if (n->getKeepClear() == false) {
153  device.writeAttr<bool>(SUMO_ATTR_KEEP_CLEAR, n->getKeepClear());
154  }
155  n->writeParams(device);
156  device.closeTag();
157  }
158  device.close();
159 }
160 
161 
162 void
164  OutputDevice& device = OutputDevice::getDevice(oc.getString("plain-output-prefix") + ".typ.xml");
165  std::map<SumoXMLAttr, std::string> attrs;
167  device.writeXMLHeader("types", "types_file.xsd", attrs);
168  tc.writeTypes(device);
169  device.close();
170 }
171 
172 
173 void
175  const GeoConvHelper& gch = GeoConvHelper::getFinal();
176  bool useGeo = oc.exists("proj.plain-geo") && oc.getBool("proj.plain-geo");
177  const bool geoAccuracy = useGeo || gch.usingInverseGeoProjection();
178 
179  std::map<SumoXMLAttr, std::string> attrs;
181  OutputDevice& edevice = OutputDevice::getDevice(oc.getString("plain-output-prefix") + ".edg.xml");
182  edevice.writeXMLHeader("edges", "edges_file.xsd", attrs);
183  OutputDevice& cdevice = OutputDevice::getDevice(oc.getString("plain-output-prefix") + ".con.xml");
184  cdevice.writeXMLHeader("connections", "connections_file.xsd", attrs);
185  const bool writeNames = oc.getBool("output.street-names");
186  for (std::map<std::string, NBEdge*>::const_iterator i = ec.begin(); i != ec.end(); ++i) {
187  // write the edge itself to the edges-files
188  NBEdge* e = (*i).second;
189  edevice.openTag(SUMO_TAG_EDGE);
190  edevice.writeAttr(SUMO_ATTR_ID, e->getID());
191  edevice.writeAttr(SUMO_ATTR_FROM, e->getFromNode()->getID());
192  edevice.writeAttr(SUMO_ATTR_TO, e->getToNode()->getID());
193  if (writeNames && e->getStreetName() != "") {
195  }
197  // write the type if given
198  if (e->getTypeID() != "") {
199  edevice.writeAttr(SUMO_ATTR_TYPE, e->getTypeID());
200  }
202  if (!e->hasLaneSpecificSpeed()) {
203  edevice.writeAttr(SUMO_ATTR_SPEED, e->getSpeed());
204  }
205  // write non-default geometry
206  if (!e->hasDefaultGeometry()) {
207  PositionVector geom = e->getGeometry();
208  if (useGeo) {
209  for (int i = 0; i < (int) geom.size(); i++) {
210  gch.cartesian2geo(geom[i]);
211  }
212  }
213  if (geoAccuracy) {
214  edevice.setPrecision(gPrecisionGeo);
215  }
216  edevice.writeAttr(SUMO_ATTR_SHAPE, geom);
217  if (geoAccuracy) {
218  edevice.setPrecision();
219  }
220  }
221  // write the spread type if not default ("right")
224  }
225  // write the length if it was specified
226  if (e->hasLoadedLength()) {
228  }
229  // some attributes can be set by edge default or per lane. Write as default if possible (efficiency)
231  edevice.writeAttr(SUMO_ATTR_WIDTH, e->getLaneWidth());
232  }
235  }
236  if (!e->hasLaneSpecificPermissions()) {
237  writePermissions(edevice, e->getPermissions(0));
238  }
239  if (e->needsLaneSpecificOutput()) {
240  for (int i = 0; i < (int)e->getLanes().size(); ++i) {
241  const NBEdge::Lane& lane = e->getLanes()[i];
242  edevice.openTag(SUMO_TAG_LANE);
243  edevice.writeAttr(SUMO_ATTR_INDEX, i);
244  // write allowed lanes
245  if (e->hasLaneSpecificPermissions()) {
246  writePermissions(edevice, lane.permissions);
247  }
248  writePreferences(edevice, lane.preferred);
249  // write other attributes
251  edevice.writeAttr(SUMO_ATTR_WIDTH, lane.width);
252  }
254  edevice.writeAttr(SUMO_ATTR_ENDOFFSET, lane.endOffset);
255  }
256  if (e->hasLaneSpecificSpeed()) {
257  edevice.writeAttr(SUMO_ATTR_SPEED, lane.speed);
258  }
259  if (lane.accelRamp) {
261  }
262  if (lane.customShape.size() > 0) {
263  edevice.writeAttr(SUMO_ATTR_SHAPE, lane.customShape);
264  }
265  if (lane.oppositeID != "") {
266  edevice.openTag(SUMO_TAG_NEIGH);
267  edevice.writeAttr(SUMO_ATTR_LANE, lane.oppositeID);
268  edevice.closeTag();
269  }
270  lane.writeParams(edevice);
271  edevice.closeTag();
272  }
273  }
274  e->writeParams(edevice);
275  edevice.closeTag();
276  // write this edge's connections to the connections-files
277  const std::vector<NBEdge::Connection> connections = e->getConnections();
278  if (connections.empty()) {
279  // if there are no connections and this appears to be customized, preserve the information
280  const int numOutgoing = (int)e->getToNode()->getOutgoingEdges().size();
281  if (numOutgoing > 0) {
282  const SVCPermissions inPerm = e->getPermissions();
283  SVCPermissions outPerm = 0;
284  for (auto out : e->getToNode()->getOutgoingEdges()) {
285  outPerm |= out->getPermissions();
286  }
287  if ((inPerm & outPerm) != 0 && (inPerm & outPerm) != SVC_PEDESTRIAN) {
288  cdevice.openTag(SUMO_TAG_CONNECTION);
289  cdevice.writeAttr(SUMO_ATTR_FROM, e->getID());
290  cdevice.closeTag();
291  cdevice << "\n";
292  }
293  }
294  } else {
295  for (std::vector<NBEdge::Connection>::const_iterator c = connections.begin(); c != connections.end(); ++c) {
296  NWWriter_SUMO::writeConnection(cdevice, *e, *c, false, NWWriter_SUMO::PLAIN);
297  }
298  cdevice << "\n";
299  }
300  }
301  // write roundabout information to the edges-files
302  if (ec.getRoundabouts().size() > 0) {
303  edevice.lf();
305  }
306 
307  // write loaded prohibitions to the connections-file
308  for (std::map<std::string, NBNode*>::const_iterator i = nc.begin(); i != nc.end(); ++i) {
309  NWWriter_SUMO::writeProhibitions(cdevice, i->second->getProhibitions());
310  }
311  // write pedestrian crossings to the connections-file
312  for (std::map<std::string, NBNode*>::const_iterator it_node = nc.begin(); it_node != nc.end(); ++it_node) {
313  const std::vector<NBNode::Crossing*>& crossings = (*it_node).second->getCrossings();
314  for (auto c : crossings) {
315  cdevice.openTag(SUMO_TAG_CROSSING);
316  cdevice.writeAttr(SUMO_ATTR_NODE, (*it_node).second->getID());
317  cdevice.writeAttr(SUMO_ATTR_EDGES, c->edges);
318  cdevice.writeAttr(SUMO_ATTR_PRIORITY, c->priority);
319  if (c->customWidth != NBEdge::UNSPECIFIED_WIDTH) {
320  cdevice.writeAttr(SUMO_ATTR_WIDTH, c->customWidth);
321  }
322  if (c->customTLIndex != -1) {
323  cdevice.writeAttr(SUMO_ATTR_TLLINKINDEX, c->customTLIndex);
324  }
325  if (c->customShape.size() != 0) {
326  cdevice.writeAttr(SUMO_ATTR_SHAPE, c->customShape);
327  }
328  cdevice.closeTag();
329  }
330  }
331  edevice.close();
332  cdevice.close();
333 }
334 
335 
336 void
338  std::map<SumoXMLAttr, std::string> attrs;
340  OutputDevice& device = OutputDevice::getDevice(oc.getString("plain-output-prefix") + ".tll.xml");
341  device.writeXMLHeader("tlLogics", "tllogic_file.xsd", attrs);
343  // we also need to remember the associations between tlLogics and connections
344  // since the information in con.xml is insufficient
345  for (std::map<std::string, NBEdge*>::const_iterator i = ec.begin(); i != ec.end(); ++i) {
346  NBEdge* e = (*i).second;
347  // write this edge's tl-controlled connections
348  const std::vector<NBEdge::Connection> connections = e->getConnections();
349  for (std::vector<NBEdge::Connection>::const_iterator c = connections.begin(); c != connections.end(); ++c) {
350  if (c->tlID != "") {
351  NWWriter_SUMO::writeConnection(device, *e, *c, false, NWWriter_SUMO::TLL);
352  }
353  }
354  }
355  device.close();
356 }
357 
358 
359 void
361  std::map<SumoXMLAttr, std::string> attrs;
363  OutputDevice& device = OutputDevice::getDevice(oc.getString("junctions.join-output"));
364  device.writeXMLHeader("nodes", "nodes_file.xsd", attrs);
365  const std::vector<std::set<std::string> >& clusters = nc.getJoinedClusters();
366  for (std::vector<std::set<std::string> >::const_iterator it = clusters.begin(); it != clusters.end(); it++) {
367  assert((*it).size() > 0);
368  device.openTag(SUMO_TAG_JOIN);
369  // prepare string
370  std::ostringstream oss;
371  for (std::set<std::string>::const_iterator it_id = it->begin(); it_id != it->end(); it_id++) {
372  oss << *it_id << " ";
373  }
374  // remove final space
375  std::string ids = oss.str();
376  device.writeAttr(SUMO_ATTR_NODES, ids.substr(0, ids.size() - 1));
377  device.closeTag();
378  }
379  device.close();
380 }
381 
382 
383 void
385  OutputDevice& device = OutputDevice::getDevice(oc.getString("street-sign-output"));
386  device.writeXMLHeader("additional", "additional_file.xsd");
387  for (std::map<std::string, NBEdge*>::const_iterator i = ec.begin(); i != ec.end(); ++i) {
388  NBEdge* e = (*i).second;
389  const std::vector<NBSign>& signs = e->getSigns();
390  for (std::vector<NBSign>::const_iterator it = signs.begin(); it != signs.end(); ++it) {
391  it->writeAsPOI(device, e);
392  }
393  }
394  device.close();
395 }
396 void
398  OutputDevice& device = OutputDevice::getDevice(oc.getString("ptstop-output"));
399  device.writeXMLHeader("additional", "additional_file.xsd");
400  for (std::map<std::string, NBPTStop*>::const_iterator i = sc.begin(); i != sc.end(); ++i) {
401  i->second->write(device);
402  }
403  device.close();
404 }
406  OutputDevice& device = OutputDevice::getDevice(oc.getString("ptline-output"));
407  device.writeXMLHeader("additional", "additional_file.xsd");
408  for (std::vector<NBPTLine*>::const_iterator i = lc.begin(); i != lc.end(); ++i) {
409  (*i)->write(device, ec);
410  }
411  device.close();
412 }
413 
415  OutputDevice& device = OutputDevice::getDevice(oc.getString("parking-output"));
416  device.writeXMLHeader("additional", "additional_file.xsd");
417  for (NBParking& p : pc) {
418  p.write(device, ec);
419  }
420  device.close();
421 }
422 
423 
424 /****************************************************************************/
425 
426 
427 /****************************************************************************/
bool getKeepClear() const
Returns the keepClear flag.
Definition: NBNode.h:276
LaneSpreadFunction getLaneSpreadFunction() const
Returns how this edge&#39;s lanes&#39; lateral offset is computed.
Definition: NBEdge.h:684
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:260
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:281
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:166
Whether vehicles must keep the junction clear.
is a pedestrian
std::map< std::string, NBNode * >::const_iterator begin() const
Returns the pointer to the begin of the stored nodes.
Definition: NBNodeCont.h:117
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:122
A container for traffic light definitions and built programs.
void writePreferences(OutputDevice &into, SVCPermissions preferred)
writes allowed disallowed attributes if needed;
connectio between two lanes
int getPriority() const
Returns the priority of the edge.
Definition: NBEdge.h:419
const std::string & getTypeID() const
get ID of type
Definition: NBEdge.h:982
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
bool hasCustomShape() const
return whether the shape was set by the user
Definition: NBNode.h:489
const std::vector< NBSign > & getSigns() const
get Signs
Definition: NBEdge.h:1204
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:70
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:1795
static void writeProhibitions(OutputDevice &into, const NBConnectionProhibits &prohibitions)
writes the given prohibitions
static const double UNSPECIFIED_RADIUS
unspecified lane width
Definition: NBNode.h:209
static const double UNSPECIFIED_OFFSET
unspecified lane offset
Definition: NBEdge.h:257
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:499
NBPTStopCont & getPTStopCont()
Returns a reference to the pt stop container.
Definition: NBNetBuilder.h:182
NBPTLineCont & getPTLineCont()
Returns a reference to the pt line container.
Definition: NBNetBuilder.h:187
const std::vector< NBEdge::Lane > & getLanes() const
Returns the lane definitions.
Definition: NBEdge.h:569
double endOffset
This lane&#39;s offset to the intersection begin.
Definition: NBEdge.h:138
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:74
static void writeTrafficLights(OutputDevice &into, const NBTrafficLightLogicCont &tllCont)
writes the traffic light logics to the given device
NBParkingCont & getParkingCont()
Definition: NBNetBuilder.h:192
static const double UNSPECIFIED_WIDTH
unspecified lane width
Definition: NBEdge.h:254
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:199
bool accelRamp
Whether this lane is an acceleration lane.
Definition: NBEdge.h:147
const EdgeVector & getOutgoingEdges() const
Returns this node&#39;s outgoing edges (The edges which start at this node)
Definition: NBNode.h:254
void writeParams(OutputDevice &out) const
void cartesian2geo(Position &cartesian) const
Converts the given cartesian (shifted) position to its geo (lat/long) representation.
An (internal) definition of a single lane of an edge.
Definition: NBEdge.h:121
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
The representation of a single pt stop.
Definition: NBParking.h:50
SVCPermissions permissions
List of vehicle types that are allowed on this lane.
Definition: NBEdge.h:132
bool isTLControlled() const
Returns whether this node is controlled by any tls.
Definition: NBNode.h:297
static void writeParkingAreas(const OptionsCont &cont, NBParkingCont &pc, NBEdgeCont &ec)
writes imported parking areas to file
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:53
bool hasLaneSpecificWidth() const
whether lanes differ in width
Definition: NBEdge.cpp:1806
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:1817
static methods for processing the coordinates conversion for the current net
Definition: GeoConvHelper.h:59
the edges of a route
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:55
std::vector< NBPTLine * >::const_iterator end() const
Returns the pointer to the end of the stored pt lines.
Definition: NBPTLineCont.h:50
SVCPermissions preferred
List of vehicle types that are preferred on this lane.
Definition: NBEdge.h:135
int getNumLanes() const
Returns the number of lanes.
Definition: NBEdge.h:412
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:45
int gPrecisionGeo
Definition: StdDefs.cpp:30
NBEdgeCont & getEdgeCont()
Definition: NBNetBuilder.h:156
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:1860
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:508
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:535
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:194
double getEndOffset() const
Returns the offset to the destination node.
Definition: NBEdge.h:547
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:61
double speed
The speed allowed on this lane.
Definition: NBEdge.h:129
double width
This lane&#39;s width.
Definition: NBEdge.h:141
SVCPermissions getPermissions(int lane=-1) const
get the union of allowed classes over all lanes or for a specific lane
Definition: NBEdge.cpp:3025
bool hasLaneSpecificPermissions() const
whether lanes differ in allowed vehicle classes
Definition: NBEdge.cpp:1781
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:1726
double getSpeed() const
Returns the speed allowed on this edge.
Definition: NBEdge.h:506
const PositionVector & getGeometry() const
Returns the geometry of the edge.
Definition: NBEdge.h:602
double getLaneWidth() const
Returns the default width of lanes of this edge.
Definition: NBEdge.h:522
double getRadius() const
Returns the turning radius of this node.
Definition: NBNode.h:271
std::string oppositeID
An opposite lane ID, if given.
Definition: NBEdge.h:144
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:845
NBNodeCont & getNodeCont()
Returns a reference to the node container.
Definition: NBNetBuilder.h:161
Instance responsible for building networks.
Definition: NBNetBuilder.h:115
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:302
Join operation.
alternative definition for junction
A storage for options typed value containers)
Definition: OptionsCont.h:98
SumoXMLNodeType getType() const
Returns the type of this node.
Definition: NBNode.h:266
NBTrafficLightLogicCont & getTLLogicCont()
Returns a reference to the traffic light logics container.
Definition: NBNetBuilder.h:171
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:241
Represents a single node (junction) during network building.
Definition: NBNode.h:74
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:70
bool closeTag()
Closes the most recently opened tag.
link: the index of the link within the traffic light
NBNode * getFromNode() const
Returns the origin node of the edge.
Definition: NBEdge.h:426
Container for nodes during the netbuilding process.
Definition: NBNodeCont.h:66
static void writePTLines(const OptionsCont &cont, NBPTLineCont &lc, NBEdgeCont &ec)
double getLoadedLength() const
Returns the length was set explicitly or the computed length if it wasn&#39;t set.
Definition: NBEdge.h:489
std::vector< NBPTLine * >::const_iterator begin() const
Returns the pointer to the begin of the stored pt lines.
Definition: NBPTLineCont.h:43
PositionVector customShape
A custom shape for this lane set by the user.
Definition: NBEdge.h:154
static const std::string MAJOR_VERSION
The version number for written files.
Definition: NWFrame.h:68
int size() const
Returns the number of known types.
Definition: NBTypeCont.h:103
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:433
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
Definition: ToString.h:236
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
void lf()
writes a line feed if applicable
Definition: OutputDevice.h:238
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:61
void writeTypes(OutputDevice &into) const
writes all types a s XML
Definition: NBTypeCont.cpp:126