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 <netbuild/NBPTLineCont.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());
79  }
80 }
81 
82 
83 void
86  bool useGeo = oc.exists("proj.plain-geo") && oc.getBool("proj.plain-geo");
87  if (useGeo && !gch.usingGeoProjection()) {
88  WRITE_WARNING("Ignoring option \"proj.plain-geo\" because no geo-conversion has been defined");
89  useGeo = false;
90  }
91  const bool geoAccuracy = useGeo || gch.usingInverseGeoProjection();
92 
93  OutputDevice& device = OutputDevice::getDevice(oc.getString("plain-output-prefix") + ".nod.xml");
94  std::map<SumoXMLAttr, std::string> attrs;
96  device.writeXMLHeader("nodes", "nodes_file.xsd", attrs);
97 
98  // write network offsets and projection to allow reconstruction of original coordinates
99  if (!useGeo) {
101  }
102 
103  // write nodes
104  for (std::map<std::string, NBNode*>::const_iterator i = nc.begin(); i != nc.end(); ++i) {
105  NBNode* n = (*i).second;
106  device.openTag(SUMO_TAG_NODE);
107  device.writeAttr(SUMO_ATTR_ID, n->getID());
108  // write position
109  Position pos = n->getPosition();
110  if (useGeo) {
111  gch.cartesian2geo(pos);
112  }
113  if (geoAccuracy) {
114  device.setPrecision(gPrecisionGeo);
115  }
116  NWFrame::writePositionLong(pos, device);
117  if (geoAccuracy) {
118  device.setPrecision();
119  }
120 
121  device.writeAttr(SUMO_ATTR_TYPE, toString(n->getType()));
122  if (n->isTLControlled()) {
123  const std::set<NBTrafficLightDefinition*>& tlss = n->getControllingTLS();
124  // set may contain multiple programs for the same id.
125  // make sure ids are unique and sorted
126  std::set<std::string> tlsIDs;
127  std::set<std::string> controlledInnerEdges;
128  for (std::set<NBTrafficLightDefinition*>::const_iterator it_tl = tlss.begin(); it_tl != tlss.end(); it_tl++) {
129  tlsIDs.insert((*it_tl)->getID());
130  std::vector<std::string> cie = (*it_tl)->getControlledInnerEdges();
131  controlledInnerEdges.insert(cie.begin(), cie.end());
132  }
133  std::vector<std::string> sortedIDs(tlsIDs.begin(), tlsIDs.end());
134  sort(sortedIDs.begin(), sortedIDs.end());
135  device.writeAttr(SUMO_ATTR_TLID, sortedIDs);
136  if (controlledInnerEdges.size() > 0) {
137  std::vector<std::string> sortedCIEs(controlledInnerEdges.begin(), controlledInnerEdges.end());
138  sort(sortedCIEs.begin(), sortedCIEs.end());
139  device.writeAttr(SUMO_ATTR_CONTROLLED_INNER, joinToString(sortedCIEs, " "));
140  }
141  }
142  if (n->hasCustomShape()) {
143  device.writeAttr(SUMO_ATTR_SHAPE, n->getShape());
144  }
146  device.writeAttr(SUMO_ATTR_RADIUS, n->getRadius());
147  }
148  if (n->getKeepClear() == false) {
149  device.writeAttr<bool>(SUMO_ATTR_KEEP_CLEAR, n->getKeepClear());
150  }
151  device.closeTag();
152  }
153  device.close();
154 }
155 
156 
157 void
159  OutputDevice& device = OutputDevice::getDevice(oc.getString("plain-output-prefix") + ".typ.xml");
160  std::map<SumoXMLAttr, std::string> attrs;
162  device.writeXMLHeader("types", "types_file.xsd", attrs);
163  tc.writeTypes(device);
164  device.close();
165 }
166 
167 
168 void
170  const GeoConvHelper& gch = GeoConvHelper::getFinal();
171  bool useGeo = oc.exists("proj.plain-geo") && oc.getBool("proj.plain-geo");
172  const bool geoAccuracy = useGeo || gch.usingInverseGeoProjection();
173  const bool hasTurns = !oc.getBool("no-turnarounds");
174 
175  std::map<SumoXMLAttr, std::string> attrs;
177  OutputDevice& edevice = OutputDevice::getDevice(oc.getString("plain-output-prefix") + ".edg.xml");
178  edevice.writeXMLHeader("edges", "edges_file.xsd", attrs);
179  OutputDevice& cdevice = OutputDevice::getDevice(oc.getString("plain-output-prefix") + ".con.xml");
180  cdevice.writeXMLHeader("connections", "connections_file.xsd", attrs);
181  const bool writeNames = oc.getBool("output.street-names");
182  for (std::map<std::string, NBEdge*>::const_iterator i = ec.begin(); i != ec.end(); ++i) {
183  // write the edge itself to the edges-files
184  NBEdge* e = (*i).second;
185  edevice.openTag(SUMO_TAG_EDGE);
186  edevice.writeAttr(SUMO_ATTR_ID, e->getID());
187  edevice.writeAttr(SUMO_ATTR_FROM, e->getFromNode()->getID());
188  edevice.writeAttr(SUMO_ATTR_TO, e->getToNode()->getID());
189  if (writeNames && e->getStreetName() != "") {
191  }
193  // write the type if given
194  if (e->getTypeID() != "") {
195  edevice.writeAttr(SUMO_ATTR_TYPE, e->getTypeID());
196  }
198  if (!e->hasLaneSpecificSpeed()) {
199  edevice.writeAttr(SUMO_ATTR_SPEED, e->getSpeed());
200  }
201  // write non-default geometry
202  if (!e->hasDefaultGeometry()) {
203  PositionVector geom = e->getGeometry();
204  if (useGeo) {
205  for (int i = 0; i < (int) geom.size(); i++) {
206  gch.cartesian2geo(geom[i]);
207  }
208  }
209  if (geoAccuracy) {
210  edevice.setPrecision(gPrecisionGeo);
211  }
212  edevice.writeAttr(SUMO_ATTR_SHAPE, geom);
213  if (geoAccuracy) {
214  edevice.setPrecision();
215  }
216  }
217  // write the spread type if not default ("right")
220  }
221  // write the length if it was specified
222  if (e->hasLoadedLength()) {
224  }
225  // some attributes can be set by edge default or per lane. Write as default if possible (efficiency)
227  edevice.writeAttr(SUMO_ATTR_WIDTH, e->getLaneWidth());
228  }
231  }
232  if (!e->hasLaneSpecificPermissions()) {
233  writePermissions(edevice, e->getPermissions(0));
234  }
235  if (e->needsLaneSpecificOutput()) {
236  for (int i = 0; i < (int)e->getLanes().size(); ++i) {
237  const NBEdge::Lane& lane = e->getLanes()[i];
238  edevice.openTag(SUMO_TAG_LANE);
239  edevice.writeAttr(SUMO_ATTR_INDEX, i);
240  // write allowed lanes
241  if (e->hasLaneSpecificPermissions()) {
242  writePermissions(edevice, lane.permissions);
243  }
244  writePreferences(edevice, lane.preferred);
245  // write other attributes
247  edevice.writeAttr(SUMO_ATTR_WIDTH, lane.width);
248  }
250  edevice.writeAttr(SUMO_ATTR_ENDOFFSET, lane.endOffset);
251  }
252  if (e->hasLaneSpecificSpeed()) {
253  edevice.writeAttr(SUMO_ATTR_SPEED, lane.speed);
254  }
255  if (lane.accelRamp) {
257  }
258  if (lane.customShape.size() > 0) {
259  edevice.writeAttr(SUMO_ATTR_SHAPE, lane.customShape);
260  }
261  if (lane.oppositeID != "") {
262  edevice.openTag(SUMO_TAG_NEIGH);
263  edevice.writeAttr(SUMO_ATTR_LANE, lane.oppositeID);
264  edevice.closeTag();
265  }
266  edevice.closeTag();
267  }
268  }
269  edevice.closeTag();
270  // write this edge's connections to the connections-files
271  const std::vector<NBEdge::Connection> connections = e->getConnections();
272  if (connections.empty()) {
273  // if there are no connections and this appears to be customized, preserve the information
274  const int numOutgoing = (int)e->getToNode()->getOutgoingEdges().size();
275  if (numOutgoing > 1 ||
276  (numOutgoing == 1 &&
277  (!e->isTurningDirectionAt(e->getToNode()->getOutgoingEdges().front()) || hasTurns))) {
278  const SVCPermissions inPerm = e->getPermissions();
279  SVCPermissions outPerm = 0;
280  for (auto out : e->getToNode()->getOutgoingEdges()) {
281  outPerm |= out->getPermissions();
282  }
283  if ((inPerm & outPerm) != 0 && (inPerm & outPerm) != SVC_PEDESTRIAN) {
284  cdevice.openTag(SUMO_TAG_CONNECTION);
285  cdevice.writeAttr(SUMO_ATTR_FROM, e->getID());
286  cdevice.closeTag();
287  cdevice << "\n";
288  }
289  }
290  } else {
291  for (std::vector<NBEdge::Connection>::const_iterator c = connections.begin(); c != connections.end(); ++c) {
292  NWWriter_SUMO::writeConnection(cdevice, *e, *c, false, NWWriter_SUMO::PLAIN);
293  }
294  cdevice << "\n";
295  }
296  }
297  // write roundabout information to the edges-files
298  if (ec.getRoundabouts().size() > 0) {
299  edevice.lf();
301  }
302 
303  // write loaded prohibitions to the connections-file
304  for (std::map<std::string, NBNode*>::const_iterator i = nc.begin(); i != nc.end(); ++i) {
305  NWWriter_SUMO::writeProhibitions(cdevice, i->second->getProhibitions());
306  }
307  // write pedestrian crossings to the connections-file
308  for (std::map<std::string, NBNode*>::const_iterator it_node = nc.begin(); it_node != nc.end(); ++it_node) {
309  const std::vector<NBNode::Crossing*>& crossings = (*it_node).second->getCrossings();
310  for (auto c : crossings) {
311  cdevice.openTag(SUMO_TAG_CROSSING);
312  cdevice.writeAttr(SUMO_ATTR_NODE, (*it_node).second->getID());
313  cdevice.writeAttr(SUMO_ATTR_EDGES, c->edges);
314  cdevice.writeAttr(SUMO_ATTR_PRIORITY, c->priority);
315  if (c->width != NBNode::DEFAULT_CROSSING_WIDTH) {
316  cdevice.writeAttr(SUMO_ATTR_WIDTH, c->width);
317  }
318  cdevice.closeTag();
319  }
320  }
321  // write customShapes to the connection-file
322  for (std::map<std::string, NBNode*>::const_iterator it_node = nc.begin(); it_node != nc.end(); ++it_node) {
323  NBNode::CustomShapeMap customShapes = (*it_node).second->getCustomLaneShapes();
324  for (NBNode::CustomShapeMap::const_iterator it = customShapes.begin(); it != customShapes.end(); ++it) {
325  cdevice.openTag(SUMO_TAG_CUSTOMSHAPE);
326  cdevice.writeAttr(SUMO_ATTR_ID, (*it).first);
327  cdevice.writeAttr(SUMO_ATTR_SHAPE, (*it).second);
328  cdevice.closeTag();
329  }
330  }
331 
332  edevice.close();
333  cdevice.close();
334 }
335 
336 
337 void
339  std::map<SumoXMLAttr, std::string> attrs;
341  OutputDevice& device = OutputDevice::getDevice(oc.getString("plain-output-prefix") + ".tll.xml");
342  device.writeXMLHeader("tlLogics", "tllogic_file.xsd", attrs);
344  // we also need to remember the associations between tlLogics and connections
345  // since the information in con.xml is insufficient
346  for (std::map<std::string, NBEdge*>::const_iterator i = ec.begin(); i != ec.end(); ++i) {
347  NBEdge* e = (*i).second;
348  // write this edge's tl-controlled connections
349  const std::vector<NBEdge::Connection> connections = e->getConnections();
350  for (std::vector<NBEdge::Connection>::const_iterator c = connections.begin(); c != connections.end(); ++c) {
351  if (c->tlID != "") {
352  NWWriter_SUMO::writeConnection(device, *e, *c, false, NWWriter_SUMO::TLL);
353  }
354  }
355  }
356  device.close();
357 }
358 
359 
360 void
362  std::map<SumoXMLAttr, std::string> attrs;
364  OutputDevice& device = OutputDevice::getDevice(oc.getString("junctions.join-output"));
365  device.writeXMLHeader("nodes", "nodes_file.xsd", attrs);
366  const std::vector<std::set<std::string> >& clusters = nc.getJoinedClusters();
367  for (std::vector<std::set<std::string> >::const_iterator it = clusters.begin(); it != clusters.end(); it++) {
368  assert((*it).size() > 0);
369  device.openTag(SUMO_TAG_JOIN);
370  // prepare string
371  std::ostringstream oss;
372  for (std::set<std::string>::const_iterator it_id = it->begin(); it_id != it->end(); it_id++) {
373  oss << *it_id << " ";
374  }
375  // remove final space
376  std::string ids = oss.str();
377  device.writeAttr(SUMO_ATTR_NODES, ids.substr(0, ids.size() - 1));
378  device.closeTag();
379  }
380  device.close();
381 }
382 
383 
384 void
386  OutputDevice& device = OutputDevice::getDevice(oc.getString("street-sign-output"));
387  device.writeXMLHeader("additional", "additional_file.xsd");
388  for (std::map<std::string, NBEdge*>::const_iterator i = ec.begin(); i != ec.end(); ++i) {
389  NBEdge* e = (*i).second;
390  const std::vector<NBSign>& signs = e->getSigns();
391  for (std::vector<NBSign>::const_iterator it = signs.begin(); it != signs.end(); ++it) {
392  it->writeAsPOI(device, e);
393  }
394  }
395  device.close();
396 }
397 void
399  OutputDevice& device = OutputDevice::getDevice(oc.getString("ptstop-output"));
400  device.writeXMLHeader("additional", "additional_file.xsd");
401  for (std::map<std::string, NBPTStop*>::const_iterator i = sc.begin(); i != sc.end(); ++i) {
402  i->second->write(device);
403  }
404  device.close();
405 }
407  OutputDevice& device = OutputDevice::getDevice(oc.getString("ptline-output"));
408  device.writeXMLHeader("additional", "additional_file.xsd");
409  for (std::vector<NBPTLine*>::const_iterator i = sc.begin(); i != sc.end(); ++i) {
410  NBPTLine* line = (*i);
411  line->write(device);
412  }
413  device.close();
414 }
415 
416 
417 /****************************************************************************/
418 
419 
420 /****************************************************************************/
The information about how to spread the lanes from the given position.
const std::vector< std::set< std::string > > & getJoinedClusters() const
gets all joined clusters (see doc for myClusters2Join)
Definition: NBNodeCont.h:275
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:261
void close()
Closes the device and removes it from the dictionary.
static void writeLocation(OutputDevice &into)
writes the location element
const std::string & getTypeID() const
get ID of type
Definition: NBEdge.h:972
bool getKeepClear() const
Returns the keepClear flag.
Definition: NBNode.h:270
void cartesian2geo(Position &cartesian) const
Converts the given cartesian (shifted) position to its geo (lat/long) representation.
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
static void writeStreetSigns(const OptionsCont &oc, NBEdgeCont &ec)
Writes street signs as POIs to file.
bool hasDefaultGeometry() const
Returns whether the geometry consists only of the node positions.
Definition: NBEdge.cpp:500
begin/end of the description of a single lane
const std::set< EdgeSet > getRoundabouts() const
Returns the determined roundabouts.
double getLoadedLength() const
Returns the length was set explicitly or the computed length if it wasn&#39;t set.
Definition: NBEdge.h:491
A container for traffic light definitions and built programs.
bool hasLaneSpecificEndOffset() const
whether lanes differ in offset
Definition: NBEdge.cpp:1801
bool isTLControlled() const
Returns whether this node is controlled by any tls.
Definition: NBNode.h:291
void writePreferences(OutputDevice &into, SVCPermissions preferred)
writes allowed disallowed attributes if needed;
const std::vector< NBEdge::Lane > & getLanes() const
Returns the lane definitions.
Definition: NBEdge.h:571
connectio between two lanes
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
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:200
static void writeJoinedJunctions(const OptionsCont &oc, NBNodeCont &nc)
Writes the joined-juncionts to file.
static void writeProhibitions(OutputDevice &into, const NBConnectionProhibits &prohibitions)
writes the given prohibitions
static const double UNSPECIFIED_RADIUS
unspecified lane width
Definition: NBNode.h:203
static const double UNSPECIFIED_OFFSET
unspecified lane offset
Definition: NBEdge.h:259
link,node: the traffic light id responsible for this link
void setPrecision(int precision=gPrecision)
Sets the precison or resets it to default.
std::map< std::string, NBPTStop * >::const_iterator begin() const
Returns the pointer to the begin of the stored pt stops.
Definition: NBPTStopCont.h:54
NBPTStopCont & getPTStopCont()
Returns a reference to the pt stop container.
Definition: NBNetBuilder.h:182
double getEndOffset() const
Returns the offset to the destination node.
Definition: NBEdge.h:549
double getSpeed() const
Returns the speed allowed on this edge.
Definition: NBEdge.h:508
bool hasCustomShape() const
return whether the shape was set by the user
Definition: NBNode.h:491
NBPTLineCont & getPTLineCont()
Returns a reference to the pt line container.
Definition: NBNetBuilder.h:187
std::vector< NBPTLine * >::const_iterator begin() const
Returns the pointer to the begin of the stored pt lines.
Definition: NBPTLineCont.h:44
double endOffset
This lane&#39;s offset to the intersection begin.
Definition: NBEdge.h:139
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:256
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:200
bool accelRamp
Whether this lane is an acceleration lane.
Definition: NBEdge.h:151
const std::vector< NBSign > & getSigns() const
get Signs
Definition: NBEdge.h:1188
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
std::map< std::string, PositionVector > CustomShapeMap
map for custon shapes
Definition: NBNode.h:85
const EdgeVector & getOutgoingEdges() const
Returns this node&#39;s outgoing edges (The edges which start at this node)
Definition: NBNode.h:248
An (internal) definition of a single lane of an edge.
Definition: NBEdge.h:122
const std::string & getID() const
Returns the id.
Definition: Named.h:66
SVCPermissions permissions
List of vehicle types that are allowed on this lane.
Definition: NBEdge.h:133
const Position & getPosition() const
Definition: NBNode.h:235
The turning radius at an intersection in m.
static void writeNodes(const OptionsCont &oc, NBNodeCont &nc)
Writes the nodes file.
std::map< std::string, NBEdge * >::const_iterator end() const
Returns the pointer to the end of the stored edges.
Definition: NBEdgeCont.h:198
double getLaneWidth() const
Returns the default width of lanes of this edge.
Definition: NBEdge.h:524
bool usingGeoProjection() const
Returns whether a transformation from geo to metric coordinates will be performed.
static methods for processing the coordinates conversion for the current net
Definition: GeoConvHelper.h:60
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:296
bool hasLaneSpecificSpeed() const
whether lanes differ in speed
Definition: NBEdge.cpp:1779
the edges of a route
int getPriority() const
Returns the priority of the edge.
Definition: NBEdge.h:421
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:136
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:156
A list of positions.
bool hasLaneSpecificPermissions() const
whether lanes differ in allowed vehicle classes
Definition: NBEdge.cpp:1765
static void writeTrafficLights(const OptionsCont &oc, NBTrafficLightLogicCont &tc, NBEdgeCont &ec)
Writes the traffic lights file.
std::map< std::string, NBPTStop * >::const_iterator end() const
Returns the pointer to the end of the stored pt stops.
Definition: NBPTStopCont.h:62
SumoXMLNodeType getType() const
Returns the type of this node.
Definition: NBNode.h:260
bool hasLoadedLength() const
Returns whether a length was set explicitly.
Definition: NBEdge.h:501
int getNumLanes() const
Returns the number of lanes.
Definition: NBEdge.h:414
bool isTurningDirectionAt(const NBEdge *const edge) const
Returns whether the given edge is the opposite direction to this edge.
Definition: NBEdge.cpp:2422
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:66
bool needsLaneSpecificOutput() const
whether at least one lane has values differing from the edges values
Definition: NBEdge.cpp:1833
static void writeNetwork(const OptionsCont &oc, NBNetBuilder &nb)
Writes the network into XML-files (nodes, edges, connections, traffic lights)
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:175
static void writePTLines(const OptionsCont &cont, NBPTLineCont &lineCont)
std::map< std::string, NBNode * >::const_iterator end() const
Returns the pointer to the end of the stored nodes.
Definition: NBNodeCont.h:119
begin/end of the description of a neighboring lane
static void writeTypes(const OptionsCont &oc, NBTypeCont &tc)
Writes the types file.
const PositionVector & getShape() const
retrieve the junction shape
Definition: NBNode.cpp:1726
static std::string escapeXML(const std::string &orig, const bool maskDoubleHyphen=false)
Replaces the standard escapes by their XML entities.
double speed
The speed allowed on this lane.
Definition: NBEdge.h:130
double width
This lane&#39;s width.
Definition: NBEdge.h:142
static void writePTStops(const OptionsCont &oc, NBPTStopCont &ec)
Writes the pt stops file.
begin/end of the description of an edge
void writeTypes(OutputDevice &into) const
writes all types a s XML
Definition: NBTypeCont.cpp:127
std::map< std::string, NBEdge * >::const_iterator begin() const
Returns the pointer to the begin of the stored edges.
Definition: NBEdgeCont.h:190
SVCPermissions getPermissions(int lane=-1) const
get the union of allowed classes over all lanes or for a specific lane
Definition: NBEdge.cpp:2988
NBNode * getToNode() const
Returns the destination node of the edge.
Definition: NBEdge.h:435
std::string oppositeID
An opposite lane ID, if given.
Definition: NBEdge.h:148
static void writeEdgesAndConnections(const OptionsCont &oc, NBNodeCont &nc, NBEdgeCont &ec)
Writes the edges and connections files.
int size() const
Returns the number of known types.
Definition: NBTypeCont.h:104
NBNodeCont & getNodeCont()
Returns a reference to the node container.
Definition: NBNetBuilder.h:161
Instance responsible for building networks.
Definition: NBNetBuilder.h:115
Custom shape for an element.
static OutputDevice & getDevice(const std::string &name)
Returns the described OutputDevice.
std::vector< NBPTLine * >::const_iterator end() const
Returns the pointer to the end of the stored pt lines.
Definition: NBPTLineCont.h:51
Join operation.
const PositionVector & getGeometry() const
Returns the geometry of the edge.
Definition: NBEdge.h:596
alternative definition for junction
A storage for options typed value containers)
Definition: OptionsCont.h:99
NBTrafficLightLogicCont & getTLLogicCont()
Returns a reference to the traffic light logics container.
Definition: NBNetBuilder.h:171
double getRadius() const
Returns the turning radius of this node.
Definition: NBNode.h:265
crossing between edges for pedestrians
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
LaneSpreadFunction getLaneSpreadFunction() const
Returns how this edge&#39;s lanes&#39; lateral offset is computed.
Definition: NBEdge.h:678
Represents a single node (junction) during network building.
Definition: NBNode.h:75
bool hasLaneSpecificWidth() const
whether lanes differ in width
Definition: NBEdge.cpp:1790
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
bool closeTag()
Closes the most recently opened tag.
Container for nodes during the netbuilding process.
Definition: NBNodeCont.h:63
bool usingInverseGeoProjection() const
Returns the information whether an inverse transformation will happen.
void write(OutputDevice &device)
Definition: NBPTLine.cpp:41
const std::string & getStreetName() const
Returns the street name of this edge.
Definition: NBEdge.h:537
const std::vector< Connection > & getConnections() const
Returns the connections.
Definition: NBEdge.h:835
PositionVector customShape
A custom shape for this lane set by the user.
Definition: NBEdge.h:158
static const std::string MAJOR_VERSION
The version number for written files.
Definition: NWFrame.h:69
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 writeRoundabouts(OutputDevice &into, const std::set< EdgeSet > &roundabouts, const NBEdgeCont &ec)
Writes roundabouts.
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
Definition: ToString.h:237
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
void lf()
writes a line feed if applicable
Definition: OutputDevice.h:239
bool exists(const std::string &name) const
Returns the information whether the named option is known.
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
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
NBNode * getFromNode() const
Returns the origin node of the edge.
Definition: NBEdge.h:428