Eclipse SUMO - Simulation of Urban MObility
NWWriter_DlrNavteq.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2012-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
15 // Exporter writing networks using DlrNavteq (Elmar) format
16 /****************************************************************************/
17 
18 
19 // ===========================================================================
20 // included modules
21 // ===========================================================================
22 #include <config.h>
23 #include <algorithm>
24 #include <ctime>
25 #include <cmath>
27 #include <netbuild/NBEdge.h>
28 #include <netbuild/NBEdgeCont.h>
29 #include <netbuild/NBNode.h>
30 #include <netbuild/NBNodeCont.h>
31 #include <netbuild/NBNetBuilder.h>
32 #include <utils/common/ToString.h>
39 #include "NWFrame.h"
40 #include "NWWriter_DlrNavteq.h"
41 
42 
43 // ---------------------------------------------------------------------------
44 // static members
45 // ---------------------------------------------------------------------------
46 const std::string NWWriter_DlrNavteq::UNDEFINED("-1");
47 
48 // ---------------------------------------------------------------------------
49 // static methods
50 // ---------------------------------------------------------------------------
51 void
53  // check whether a matsim-file shall be generated
54  if (!oc.isSet("dlr-navteq-output")) {
55  return;
56  }
57  std::map<NBEdge*, std::string> internalNodes;
58  writeNodesUnsplitted(oc, nb.getNodeCont(), nb.getEdgeCont(), internalNodes);
59  writeLinksUnsplitted(oc, nb.getEdgeCont(), internalNodes);
63 }
64 
65 
67  device << "# Format matches Extraction version: V6.5 \n";
68  std::stringstream tmp;
69  oc.writeConfiguration(tmp, true, false, false);
70  tmp.seekg(std::ios_base::beg);
71  std::string line;
72  while (!tmp.eof()) {
73  std::getline(tmp, line);
74  device << "# " << line << "\n";
75  }
76  device << "#\n";
77 }
78 
79 void
80 NWWriter_DlrNavteq::writeNodesUnsplitted(const OptionsCont& oc, NBNodeCont& nc, NBEdgeCont& ec, std::map<NBEdge*, std::string>& internalNodes) {
81  // For "real" nodes we simply use the node id.
82  // For internal nodes (geometry vectors describing edge geometry in the parlance of this format)
83  // we use the id of the edge and do not bother with
84  // compression (each direction gets its own internal node).
85  OutputDevice& device = OutputDevice::getDevice(oc.getString("dlr-navteq-output") + "_nodes_unsplitted.txt");
86  writeHeader(device, oc);
88  const bool haveGeo = gch.usingGeoProjection();
89  const double geoScale = pow(10.0f, haveGeo ? 5 : 2); // see NIImporter_DlrNavteq::GEO_SCALE
90  device.setPrecision(oc.getInt("dlr-navteq.precision"));
91  if (!haveGeo) {
92  WRITE_WARNING("DlrNavteq node data will be written in (floating point) cartesian coordinates");
93  }
94  // write format specifier
95  device << "# NODE_ID\tIS_BETWEEN_NODE\tamount_of_geocoordinates\tx1\ty1\t[x2 y2 ... xn yn]\n";
96  // write header
97  Boundary boundary = gch.getConvBoundary();
98  Position min(boundary.xmin(), boundary.ymin());
99  Position max(boundary.xmax(), boundary.ymax());
100  gch.cartesian2geo(min);
101  min.mul(geoScale);
102  gch.cartesian2geo(max);
103  max.mul(geoScale);
104  int multinodes = 0;
105  for (std::map<std::string, NBEdge*>::const_iterator i = ec.begin(); i != ec.end(); ++i) {
106  if ((*i).second->getGeometry().size() > 2) {
107  multinodes++;
108  }
109  }
110  device << "# [xmin_region] " << min.x() << "\n";
111  device << "# [xmax_region] " << max.x() << "\n";
112  device << "# [ymin_region] " << min.y() << "\n";
113  device << "# [ymax_region] " << max.y() << "\n";
114  device << "# [elements_multinode] " << multinodes << "\n";
115  device << "# [elements_normalnode] " << nc.size() << "\n";
116  device << "# [xmin] " << min.x() << "\n";
117  device << "# [xmax] " << max.x() << "\n";
118  device << "# [ymin] " << min.y() << "\n";
119  device << "# [ymax] " << max.y() << "\n";
120  // write normal nodes
121  for (std::map<std::string, NBNode*>::const_iterator i = nc.begin(); i != nc.end(); ++i) {
122  NBNode* n = (*i).second;
123  Position pos = n->getPosition();
124  gch.cartesian2geo(pos);
125  pos.mul(geoScale);
126  device << n->getID() << "\t0\t1\t" << pos.x() << "\t" << pos.y() << "\n";
127  }
128  // write "internal" nodes
129  std::vector<std::string> avoid;
130  std::set<std::string> reservedNodeIDs;
131  const bool numericalIDs = oc.getBool("numerical-ids");
132  if (oc.isSet("reserved-ids")) {
133  NBHelpers::loadPrefixedIDsFomFile(oc.getString("reserved-ids"), "node:", reservedNodeIDs); // backward compatibility
134  NBHelpers::loadPrefixedIDsFomFile(oc.getString("reserved-ids"), "junction:", reservedNodeIDs); // selection format
135  }
136  if (numericalIDs) {
137  avoid = nc.getAllNames();
138  std::vector<std::string> avoid2 = ec.getAllNames();
139  avoid.insert(avoid.end(), avoid2.begin(), avoid2.end());
140  avoid.insert(avoid.end(), reservedNodeIDs.begin(), reservedNodeIDs.end());
141  }
142  IDSupplier idSupplier("", avoid);
143  for (std::map<std::string, NBEdge*>::const_iterator i = ec.begin(); i != ec.end(); ++i) {
144  NBEdge* e = (*i).second;
145  PositionVector geom = e->getGeometry();
146  if (geom.size() > 2) {
147  // the import NIImporter_DlrNavteq checks for the presence of a
148  // negated edge id to determine spread type. We may need to do some
149  // shifting to make this consistent
150  const bool hasOppositeID = ec.getOppositeByID(e->getID()) != nullptr;
151  if (e->getLaneSpreadFunction() == LANESPREAD_RIGHT && !hasOppositeID) {
152  // need to write center-line geometry instead
153  try {
154  geom.move2side(e->getTotalWidth() / 2);
155  } catch (InvalidArgument& exception) {
156  WRITE_WARNING("Could not reconstruct shape for edge:'" + e->getID() + "' (" + exception.what() + ").");
157  }
158  } else if (e->getLaneSpreadFunction() == LANESPREAD_CENTER && hasOppositeID) {
159  // need to write left-border geometry instead
160  try {
161  geom.move2side(-e->getTotalWidth() / 2);
162  } catch (InvalidArgument& exception) {
163  WRITE_WARNING("Could not reconstruct shape for edge:'" + e->getID() + "' (" + exception.what() + ").");
164  }
165  }
166 
167  std::string internalNodeID = e->getID();
168  if (internalNodeID == UNDEFINED
169  || (nc.retrieve(internalNodeID) != nullptr)
170  || reservedNodeIDs.count(internalNodeID) > 0
171  ) {
172  // need to invent a new name to avoid clashing with the id of a 'real' node or a reserved name
173  if (numericalIDs) {
174  internalNodeID = idSupplier.getNext();
175  } else {
176  internalNodeID += "_geometry";
177  }
178  }
179  internalNodes[e] = internalNodeID;
180  device << internalNodeID << "\t1\t" << geom.size() - 2;
181  for (int ii = 1; ii < (int)geom.size() - 1; ++ii) {
182  Position pos = geom[(int)ii];
183  gch.cartesian2geo(pos);
184  pos.mul(geoScale);
185  device << "\t" << pos.x() << "\t" << pos.y();
186  }
187  device << "\n";
188  }
189  }
190  device.close();
191 }
192 
193 
194 void
195 NWWriter_DlrNavteq::writeLinksUnsplitted(const OptionsCont& oc, NBEdgeCont& ec, std::map<NBEdge*, std::string>& internalNodes) {
196  std::map<const std::string, std::string> nameIDs;
197  OutputDevice& device = OutputDevice::getDevice(oc.getString("dlr-navteq-output") + "_links_unsplitted.txt");
198  writeHeader(device, oc);
199  // write format specifier
200  device << "# LINK_ID\tNODE_ID_FROM\tNODE_ID_TO\tBETWEEN_NODE_ID\tLENGTH\tVEHICLE_TYPE\tFORM_OF_WAY\tBRUNNEL_TYPE\tFUNCTIONAL_ROAD_CLASS\tSPEED_CATEGORY\tNUMBER_OF_LANES\tSPEED_LIMIT\tSPEED_RESTRICTION\tNAME_ID1_REGIONAL\tNAME_ID2_LOCAL\tHOUSENUMBERS_RIGHT\tHOUSENUMBERS_LEFT\tZIP_CODE\tAREA_ID\tSUBAREA_ID\tTHROUGH_TRAFFIC\tSPECIAL_RESTRICTIONS\tEXTENDED_NUMBER_OF_LANES\tISRAMP\tCONNECTION\n";
201  // write edges
202  for (std::map<std::string, NBEdge*>::const_iterator i = ec.begin(); i != ec.end(); ++i) {
203  NBEdge* e = (*i).second;
204  const int kph = speedInKph(e->getSpeed());
205  const std::string& betweenNodeID = (e->getGeometry().size() > 2) ? internalNodes[e] : UNDEFINED;
206  std::string nameID = UNDEFINED;
207  std::string nameIDRegional = UNDEFINED;
208  if (oc.getBool("output.street-names")) {
209  const std::string& name = e->getStreetName();
210  if (name != "") {
211  if (nameIDs.count(name) == 0) {
212  nameIDs[name] = toString(nameIDs.size());
213  }
214  nameID = nameIDs[name];
215  }
216  const std::string& name2 = e->getParameter("ref", "");
217  if (name2 != "") {
218  if (nameIDs.count(name2) == 0) {
219  nameIDs[name2] = toString(nameIDs.size());
220  }
221  nameIDRegional = nameIDs[name2];
222  }
223  }
224  device << e->getID() << "\t"
225  << e->getFromNode()->getID() << "\t"
226  << e->getToNode()->getID() << "\t"
227  << betweenNodeID << "\t"
228  << getGraphLength(e) << "\t"
229  << getAllowedTypes(e->getPermissions()) << "\t"
230  << getFormOfWay(e) << "\t"
231  << getBrunnelType(e) << "\t"
232  << getRoadClass(e) << "\t"
233  << getSpeedCategory(kph) << "\t"
234  << getNavteqLaneCode(e->getNumLanes()) << "\t"
235  << getSpeedCategoryUpperBound(kph) << "\t"
236  << kph << "\t"
237  << nameIDRegional << "\t"
238  << nameID << "\t" // NAME_ID2_LOCAL
239  << UNDEFINED << "\t" // housenumbers_right
240  << UNDEFINED << "\t" // housenumbers_left
241  << getSinglePostalCode(e->getParameter("postal_code", UNDEFINED), e->getID()) << "\t" // ZIP_CODE
242  << UNDEFINED << "\t" // AREA_ID
243  << UNDEFINED << "\t" // SUBAREA_ID
244  << "1\t" // through_traffic (allowed)
245  << UNDEFINED << "\t" // special_restrictions
246  << UNDEFINED << "\t" // extended_number_of_lanes
247  << UNDEFINED << "\t" // isRamp
248  << "0\t" // connection (between nodes always in order)
249  << "\n";
250  }
251  if (oc.getBool("output.street-names")) {
252  OutputDevice& namesDevice = OutputDevice::getDevice(oc.getString("dlr-navteq-output") + "_names.txt");
253  writeHeader(namesDevice, oc);
254  // write format specifier
255  namesDevice << "# NAME_ID\tPERMANENT_ID_INFO\tName\n";
256  namesDevice << "# [elements] " << nameIDs.size() << "\n";
257  for (std::map<const std::string, std::string>::const_iterator i = nameIDs.begin(); i != nameIDs.end(); ++i) {
258  namesDevice
259  << i->second << "\t"
260  << 0 << "\t"
261  << i->first << "\n";
262  }
263  namesDevice.close();
264  }
265  device.close();
266 }
267 
268 
269 std::string
271  if (permissions == SVCAll) {
272  return "100000000000";
273  }
274  std::ostringstream oss;
275  oss << "0";
276  oss << ((permissions & SVC_PASSENGER) > 0 ? 1 : 0);
277  oss << ((permissions & SVC_PASSENGER) > 0 ? 1 : 0); // residential
278  oss << ((permissions & SVC_HOV) > 0 ? 1 : 0);
279  oss << ((permissions & SVC_EMERGENCY) > 0 ? 1 : 0);
280  oss << ((permissions & SVC_TAXI) > 0 ? 1 : 0);
281  oss << ((permissions & (SVC_BUS | SVC_COACH)) > 0 ? 1 : 0);
282  oss << ((permissions & SVC_DELIVERY) > 0 ? 1 : 0);
283  oss << ((permissions & (SVC_TRUCK | SVC_TRAILER)) > 0 ? 1 : 0);
284  oss << ((permissions & SVC_MOTORCYCLE) > 0 ? 1 : 0);
285  oss << ((permissions & SVC_BICYCLE) > 0 ? 1 : 0);
286  oss << ((permissions & SVC_PEDESTRIAN) > 0 ? 1 : 0);
287  return oss.str();
288 }
289 
290 
291 int
293  // quoting the navteq manual:
294  // As a general rule, Functional Road Class assignments have no direct
295  // correlation with other road attributes like speed, controlled access, route type, etc.
296  // if the network is based on OSM, we can use the highway types for determining FRC
297  std::string type = edge->getTypeID();
298  if (StringUtils::startsWith(type, "highway.")) {
299  type = type.substr(8);
300  }
301  if (StringUtils::startsWith(type, "motorway")) {
302  return 0;
303  } else if (StringUtils::startsWith(type, "trunk")) {
304  return 1;
305  } else if (StringUtils::startsWith(type, "primary")) {
306  return 1;
307  } else if (StringUtils::startsWith(type, "secondary")) {
308  return 2;
309  } else if (StringUtils::startsWith(type, "tertiary")) {
310  return 3;
311  } else if (type == "unclassified") {
312  return 3;
313  } else if (type == "living_street" || type == "residential" || type == "road" || type == "service" || type == "track" || type == "cycleway" || type == "path" || type == "footway") {
314  return 4;
315  }
316  // as a fallback we do a simple speed / lane-count mapping anyway
317  // the resulting functional road class layers probably won't be connected as required
318  const int kph = speedInKph(edge->getSpeed());
319  if ((kph) > 100) {
320  return 0;
321  }
322  if ((kph) > 70) {
323  return 1;
324  }
325  if ((kph) > 50) {
326  return (edge->getNumLanes() > 1 ? 2 : 3);
327  }
328  if ((kph) > 30) {
329  return 3;
330  }
331  return 4;
332 }
333 
334 
335 int
337  if ((kph) > 130) {
338  return 1;
339  }
340  if ((kph) > 100) {
341  return 2;
342  }
343  if ((kph) > 90) {
344  return 3;
345  }
346  if ((kph) > 70) {
347  return 4;
348  }
349  if ((kph) > 50) {
350  return 5;
351  }
352  if ((kph) > 30) {
353  return 6;
354  }
355  if ((kph) > 10) {
356  return 7;
357  }
358  return 8;
359 }
360 
361 
362 int
364  if ((kph) > 130) {
365  return 131;
366  }
367  if ((kph) > 100) {
368  return 130;
369  }
370  if ((kph) > 90) {
371  return 100;
372  }
373  if ((kph) > 70) {
374  return 90;
375  }
376  if ((kph) > 50) {
377  return 70;
378  }
379  if ((kph) > 30) {
380  return 50;
381  }
382  if ((kph) > 10) {
383  return 30;
384  }
385  return 10;
386 }
387 
388 
389 int
391  const int code = (numLanes == 1 ? 1 :
392  (numLanes < 4 ? 2 : 3));
393  return numLanes * 10 + code;
394 }
395 
396 
397 int
399  if (edge->knowsParameter("bridge")) {
400  return 1;
401  } else if (edge->knowsParameter("tunnel")) {
402  return 4;
403  } else if (edge->getTypeID() == "route.ferry") {
404  return 10;
405  }
406  return -1; // UNDEFINED
407 }
408 
409 
410 int
412  if (edge->getPermissions() == SVC_PEDESTRIAN) {
413  return 15;
414  } else if (edge->getJunctionPriority(edge->getToNode()) == NBEdge::ROUNDABOUT) {
415  return 4;
416  } else if (edge->getTypeID() == "highway.service") {
417  return 14;
418  } else if (edge->getTypeID().find("_link") != std::string::npos) {
419  return 10;
420  }
421  return 3; // speed category 1-8;
422 }
423 
424 
425 double
427  PositionVector geom = edge->getGeometry();
430  return geom.length();
431 }
432 
433 
434 std::string
435 NWWriter_DlrNavteq::getSinglePostalCode(const std::string& zipCode, const std::string edgeID) {
436  // might be multiple codes
437  if (zipCode.find_first_of(" ,;") != std::string::npos) {
438  WRITE_WARNING("ambiguous zip code '" + zipCode + "' for edge '" + edgeID + "'. (using first value)");
439  StringTokenizer st(zipCode, " ,;", true);
440  std::vector<std::string> ret = st.getVector();
441  return ret[0];
442  } else if (zipCode.size() > 16) {
443  WRITE_WARNING("long zip code '" + zipCode + "' for edge '" + edgeID + "'");
444  }
445  return zipCode;
446 }
447 
448 void
450  OutputDevice& device = OutputDevice::getDevice(oc.getString("dlr-navteq-output") + "_traffic_signals.txt");
451  writeHeader(device, oc);
452  const GeoConvHelper& gch = GeoConvHelper::getFinal();
453  const bool haveGeo = gch.usingGeoProjection();
454  const double geoScale = pow(10.0f, haveGeo ? 5 : 2); // see NIImporter_DlrNavteq::GEO_SCALE
455  device.setPrecision(oc.getInt("dlr-navteq.precision"));
456  // write format specifier
457  device << "#Traffic signal related to LINK_ID and NODE_ID with location relative to driving direction.\n#column format like pointcollection.\n#DESCRIPTION->LOCATION: 1-rechts von LINK; 2-links von LINK; 3-oberhalb LINK -1-keineAngabe\n#RELATREC_ID\tPOICOL_TYPE\tDESCRIPTION\tLONGITUDE\tLATITUDE\tLINK_ID\n";
458  // write record for every edge incoming to a tls controlled node
459  for (std::map<std::string, NBNode*>::const_iterator i = nc.begin(); i != nc.end(); ++i) {
460  NBNode* n = (*i).second;
461  if (n->isTLControlled()) {
462  Position pos = n->getPosition();
463  gch.cartesian2geo(pos);
464  pos.mul(geoScale);
465  const EdgeVector& incoming = n->getIncomingEdges();
466  for (EdgeVector::const_iterator it = incoming.begin(); it != incoming.end(); ++it) {
467  NBEdge* e = *it;
468  device << e->getID() << "\t"
469  << "12\t" // POICOL_TYPE
470  << "LSA;NODEIDS#" << n->getID() << "#;LOCATION#-1#;\t"
471  << pos.x() << "\t"
472  << pos.y() << "\t"
473  << e->getID() << "\n";
474  }
475  }
476  }
477  device.close();
478 }
479 
480 
481 void
483  OutputDevice& device = OutputDevice::getDevice(oc.getString("dlr-navteq-output") + "_prohibited_manoeuvres.txt");
484  writeHeader(device, oc);
485  // need to invent id for relation
486  std::set<std::string> reservedRelIDs;
487  if (oc.isSet("reserved-ids")) {
488  NBHelpers::loadPrefixedIDsFomFile(oc.getString("reserved-ids"), "rel:", reservedRelIDs);
489  }
490  std::vector<std::string> avoid = ec.getAllNames(); // already used for tls RELATREC_ID
491  avoid.insert(avoid.end(), reservedRelIDs.begin(), reservedRelIDs.end());
492  IDSupplier idSupplier("", avoid); // @note: use a global relRecIDsupplier if this is used more often
493  // write format specifier
494  device << "#No driving allowed from ID1 to ID2 or the complete chain from ID1 to IDn\n";
495  device << "#RELATREC_ID\tPERMANENT_ID_INFO\tVALIDITY_PERIOD\tTHROUGH_TRAFFIC\tVEHICLE_TYPE\tNAVTEQ_LINK_ID1\t[NAVTEQ_LINK_ID2 ...]\n";
496  // write record for every pair of incoming/outgoing edge that are not connected despite having common permissions
497  for (std::map<std::string, NBNode*>::const_iterator i = nc.begin(); i != nc.end(); ++i) {
498  NBNode* n = (*i).second;
499  const EdgeVector& incoming = n->getIncomingEdges();
500  const EdgeVector& outgoing = n->getOutgoingEdges();
501  for (EdgeVector::const_iterator j = incoming.begin(); j != incoming.end(); ++j) {
502  NBEdge* inEdge = *j;
503  const SVCPermissions inPerm = inEdge->getPermissions();
504  for (EdgeVector::const_iterator k = outgoing.begin(); k != outgoing.end(); ++k) {
505  NBEdge* outEdge = *k;
506  const SVCPermissions outPerm = outEdge->getPermissions();
507  const SVCPermissions commonPerm = inPerm & outPerm;
508  if (commonPerm != 0 && commonPerm != SVC_PEDESTRIAN && !inEdge->isConnectedTo(outEdge)) {
509  device
510  << idSupplier.getNext() << "\t"
511  << 1 << "\t" // permanent id
512  << UNDEFINED << "\t"
513  << 1 << "\t"
514  << getAllowedTypes(SVCAll) << "\t"
515  << inEdge->getID() << "\t" << outEdge->getID() << "\n";
516  }
517  }
518  }
519  }
520  device.close();
521 }
522 
523 
524 void
526  OutputDevice& device = OutputDevice::getDevice(oc.getString("dlr-navteq-output") + "_connected_lanes.txt");
527  writeHeader(device, oc);
528  // write format specifier
529  device << "#Lane connections related to LINK-IDs and NODE-ID.\n";
530  device << "#column format like pointcollection.\n";
531  device << "#NODE-ID\tVEHICLE-TYPE\tFROM_LANE\tTO_LANE\tTHROUGH_TRAFFIC\tLINK_IDs[2..*]\n";
532  // write record for every connection
533  for (std::map<std::string, NBNode*>::const_iterator i = nc.begin(); i != nc.end(); ++i) {
534  NBNode* n = (*i).second;
535  const EdgeVector& incoming = n->getIncomingEdges();
536  for (EdgeVector::const_iterator j = incoming.begin(); j != incoming.end(); ++j) {
537  NBEdge* from = *j;
538  const SVCPermissions fromPerm = from->getPermissions();
539  const std::vector<NBEdge::Connection>& connections = from->getConnections();
540  for (std::vector<NBEdge::Connection>::const_iterator it_c = connections.begin(); it_c != connections.end(); it_c++) {
541  const NBEdge::Connection& c = *it_c;
542  device
543  << n->getID() << "\t"
544  << getAllowedTypes(fromPerm & c.toEdge->getPermissions()) << "\t"
545  << c.fromLane + 1 << "\t" // one-based
546  << c.toLane + 1 << "\t" // one-based
547  << 1 << "\t" // no information regarding permissibility of through traffic
548  << from->getID() << "\t"
549  << c.toEdge->getID() << "\t"
550  << "\n";
551  }
552  }
553  }
554  device.close();
555 }
556 
557 /****************************************************************************/
558 
OptionsCont::isSet
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
Definition: OptionsCont.cpp:135
SVC_PEDESTRIAN
@ SVC_PEDESTRIAN
pedestrian
Definition: SUMOVehicleClass.h:156
NWWriter_DlrNavteq::getBrunnelType
static int getBrunnelType(NBEdge *edge)
get the navteq brunnel type
Definition: NWWriter_DlrNavteq.cpp:398
OptionsCont::getInt
int getInt(const std::string &name) const
Returns the int-value of the named option (only for Option_Integer)
Definition: OptionsCont.cpp:215
ToString.h
NBEdge::Connection::toEdge
NBEdge * toEdge
The edge the connections yields in.
Definition: NBEdge.h:212
NBEdge::ROUNDABOUT
@ ROUNDABOUT
Definition: NBEdge.h:348
NWWriter_DlrNavteq::writeNetwork
static void writeNetwork(const OptionsCont &oc, NBNetBuilder &nb)
Writes the network into XML-files (nodes, edges, connections, traffic lights)
Definition: NWWriter_DlrNavteq.cpp:52
NWFrame.h
NBEdge::isConnectedTo
bool isConnectedTo(const NBEdge *e) const
Returns the information whethe a connection to the given edge has been added (or computed)
Definition: NBEdge.cpp:1149
SVC_EMERGENCY
@ SVC_EMERGENCY
public emergency vehicles
Definition: SUMOVehicleClass.h:143
WRITE_WARNING
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:275
GeoConvHelper::getConvBoundary
const Boundary & getConvBoundary() const
Returns the converted boundary.
Definition: GeoConvHelper.cpp:489
NBEdgeCont
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:60
SVC_COACH
@ SVC_COACH
vehicle is a coach
Definition: SUMOVehicleClass.h:167
NBNetBuilder
Instance responsible for building networks.
Definition: NBNetBuilder.h:109
NWWriter_DlrNavteq::writeTrafficSignals
static void writeTrafficSignals(const OptionsCont &oc, NBNodeCont &nc)
Writes the traffic_signals file.
Definition: NWWriter_DlrNavteq.cpp:449
Boundary::ymin
double ymin() const
Returns minimum y-coordinate.
Definition: Boundary.cpp:130
OutputDevice
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:63
NBNodeCont::end
std::map< std::string, NBNode * >::const_iterator end() const
Returns the pointer to the end of the stored nodes.
Definition: NBNodeCont.h:120
NBEdgeCont::getOppositeByID
NBEdge * getOppositeByID(const std::string &edgeID) const
Returns the edge with negated id if it exists.
Definition: NBEdgeCont.cpp:1038
OptionsCont.h
LANESPREAD_RIGHT
@ LANESPREAD_RIGHT
Definition: SUMOXMLDefinitions.h:1098
MsgHandler.h
EdgeVector
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
Definition: NBCont.h:34
NBNodeCont::getAllNames
std::vector< std::string > getAllNames() const
get all node names
Definition: NBNodeCont.cpp:1799
OptionsCont::getString
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
Definition: OptionsCont.cpp:201
NBNode::getOutgoingEdges
const EdgeVector & getOutgoingEdges() const
Returns this node's outgoing edges (The edges which start at this node)
Definition: NBNode.h:260
OutputDevice::setPrecision
void setPrecision(int precision=gPrecision)
Sets the precison or resets it to default.
Definition: OutputDevice.cpp:221
NBEdgeCont.h
GeoConvHelper.h
Boundary::xmax
double xmax() const
Returns maximum x-coordinate.
Definition: Boundary.cpp:124
NBNodeCont::begin
std::map< std::string, NBNode * >::const_iterator begin() const
Returns the pointer to the begin of the stored nodes.
Definition: NBNodeCont.h:115
IDSupplier
Definition: IDSupplier.h:37
OptionsCont::getBool
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
Definition: OptionsCont.cpp:222
SVC_BICYCLE
@ SVC_BICYCLE
vehicle is a bicycle
Definition: SUMOVehicleClass.h:179
SVC_DELIVERY
@ SVC_DELIVERY
vehicle is a small delivery vehicle
Definition: SUMOVehicleClass.h:169
PositionVector::length
double length() const
Returns the length.
Definition: PositionVector.cpp:484
NBEdge::getPermissions
SVCPermissions getPermissions(int lane=-1) const
get the union of allowed classes over all lanes or for a specific lane
Definition: NBEdge.cpp:3404
PositionVector
A list of positions.
Definition: PositionVector.h:45
OutputDevice::close
void close()
Closes the device and removes it from the dictionary.
Definition: OutputDevice.cpp:207
GeoConvHelper
static methods for processing the coordinates conversion for the current net
Definition: GeoConvHelper.h:55
LANESPREAD_CENTER
@ LANESPREAD_CENTER
Definition: SUMOXMLDefinitions.h:1099
GeoConvHelper::usingGeoProjection
bool usingGeoProjection() const
Returns whether a transformation from geo to metric coordinates will be performed.
Definition: GeoConvHelper.cpp:281
NWWriter_DlrNavteq::getFormOfWay
static int getFormOfWay(NBEdge *edge)
get the form of way
Definition: NWWriter_DlrNavteq.cpp:411
NWWriter_DlrNavteq::speedInKph
static int speedInKph(double metersPerSecond)
get edge speed rounded to kmh
Definition: NWWriter_DlrNavteq.h:130
NBNodeCont
Container for nodes during the netbuilding process.
Definition: NBNodeCont.h:59
NBNetBuilder::getEdgeCont
NBEdgeCont & getEdgeCont()
Definition: NBNetBuilder.h:150
NBEdge::Connection::fromLane
int fromLane
The lane the connections starts at.
Definition: NBEdge.h:209
NWWriter_DlrNavteq::getGraphLength
static double getGraphLength(NBEdge *edge)
get the length of the edge when measured up to the junction center
Definition: NWWriter_DlrNavteq.cpp:426
Parameterised::getParameter
const std::string getParameter(const std::string &key, const std::string &defaultValue="") const
Returns the value for a given key.
Definition: Parameterised.cpp:72
NBEdge
The representation of a single edge during network building.
Definition: NBEdge.h:91
NWWriter_DlrNavteq::getSpeedCategory
static int getSpeedCategory(int kph)
get the navteq speed class based on the speed in km/h
Definition: NWWriter_DlrNavteq.cpp:336
NBEdge::Connection::toLane
int toLane
The lane the connections yields in.
Definition: NBEdge.h:215
NBNode::getPosition
const Position & getPosition() const
Definition: NBNode.h:247
NBHelpers::loadPrefixedIDsFomFile
static void loadPrefixedIDsFomFile(const std::string &file, const std::string prefix, std::set< std::string > &into)
Add prefixed ids defined in file.
Definition: NBHelpers.cpp:105
NWWriter_DlrNavteq::getSinglePostalCode
static std::string getSinglePostalCode(const std::string &zipCode, const std::string edgeID)
Definition: NWWriter_DlrNavteq.cpp:435
NBEdge::getToNode
NBNode * getToNode() const
Returns the destination node of the edge.
Definition: NBEdge.h:498
NBNode::isTLControlled
bool isTLControlled() const
Returns whether this node is controlled by any tls.
Definition: NBNode.h:313
NBEdge::getGeometry
const PositionVector & getGeometry() const
Returns the geometry of the edge.
Definition: NBEdge.h:692
PositionVector::push_back_noDoublePos
void push_back_noDoublePos(const Position &p)
insert in back a non double position
Definition: PositionVector.cpp:1295
SVC_TRUCK
@ SVC_TRUCK
vehicle is a large transport vehicle
Definition: SUMOVehicleClass.h:171
Boundary::xmin
double xmin() const
Returns minimum x-coordinate.
Definition: Boundary.cpp:118
GeoConvHelper::getFinal
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
Definition: GeoConvHelper.h:105
SVCPermissions
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
Definition: SUMOVehicleClass.h:218
SVC_HOV
@ SVC_HOV
vehicle is a HOV
Definition: SUMOVehicleClass.h:161
StringTokenizer
Definition: StringTokenizer.h:61
NWWriter_DlrNavteq::getAllowedTypes
static std::string getAllowedTypes(SVCPermissions permissions)
build the ascii-bit-vector for column vehicle_type
Definition: NWWriter_DlrNavteq.cpp:270
SVC_PASSENGER
@ SVC_PASSENGER
vehicle is a passenger car (a "normal" car)
Definition: SUMOVehicleClass.h:159
Boundary
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:41
NBEdge::getNumLanes
int getNumLanes() const
Returns the number of lanes.
Definition: NBEdge.h:477
OutputDevice.h
NBNetBuilder.h
GeoConvHelper::cartesian2geo
void cartesian2geo(Position &cartesian) const
Converts the given cartesian (shifted) position to its geo (lat/long) representation.
Definition: GeoConvHelper.cpp:293
NWWriter_DlrNavteq::getNavteqLaneCode
static int getNavteqLaneCode(const int numLanes)
get the lane number encoding
Definition: NWWriter_DlrNavteq.cpp:390
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:38
Position::x
double x() const
Returns the x-position.
Definition: Position.h:56
NBEdge::getTotalWidth
double getTotalWidth() const
Returns the combined width of all lanes of this edge.
Definition: NBEdge.cpp:3276
OptionsCont
A storage for options typed value containers)
Definition: OptionsCont.h:89
StringUtils::startsWith
static bool startsWith(const std::string &str, const std::string prefix)
Checks whether a given string starts with the prefix.
Definition: StringUtils.cpp:174
IDSupplier.h
NWWriter_DlrNavteq::writeConnectedLanes
static void writeConnectedLanes(const OptionsCont &oc, NBNodeCont &nc)
Writes the connected_lanes file.
Definition: NWWriter_DlrNavteq.cpp:525
Position::mul
void mul(double val)
Multiplies both positions with the given value.
Definition: Position.h:106
NWWriter_DlrNavteq::writeHeader
static void writeHeader(OutputDevice &device, const OptionsCont &oc)
write header comments (input paramters, date, etc...)
Definition: NWWriter_DlrNavteq.cpp:66
NBEdgeCont::end
std::map< std::string, NBEdge * >::const_iterator end() const
Returns the pointer to the end of the stored edges.
Definition: NBEdgeCont.h:192
NBNodeCont::retrieve
NBNode * retrieve(const std::string &id) const
Returns the node with the given name.
Definition: NBNodeCont.cpp:107
NBEdge::getStreetName
const std::string & getStreetName() const
Returns the street name of this edge.
Definition: NBEdge.h:600
NBEdgeCont::getAllNames
std::vector< std::string > getAllNames() const
Returns all ids of known edges.
Definition: NBEdgeCont.cpp:689
NBNodeCont.h
toString
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:47
StringUtils.h
OutputDevice::getDevice
static OutputDevice & getDevice(const std::string &name)
Returns the described OutputDevice.
Definition: OutputDevice.cpp:54
Position::y
double y() const
Returns the y-position.
Definition: Position.h:61
NBEdge::getJunctionPriority
int getJunctionPriority(const NBNode *const node) const
Returns the junction priority (normalised for the node currently build)
Definition: NBEdge.cpp:1816
NBEdge::getSpeed
double getSpeed() const
Returns the speed allowed on this edge.
Definition: NBEdge.h:571
SVC_TAXI
@ SVC_TAXI
vehicle is a taxi
Definition: SUMOVehicleClass.h:163
InvalidArgument
Definition: UtilExceptions.h:56
NWWriter_DlrNavteq::writeProhibitedManoeuvres
static void writeProhibitedManoeuvres(const OptionsCont &oc, const NBNodeCont &nc, const NBEdgeCont &ec)
Writes the prohibited_manoeuvres file.
Definition: NWWriter_DlrNavteq.cpp:482
SVCAll
const SVCPermissions SVCAll
all VClasses are allowed
Definition: SUMOVehicleClass.cpp:146
NBNode::getIncomingEdges
const EdgeVector & getIncomingEdges() const
Returns this node's incoming edges (The edges which yield in this node)
Definition: NBNode.h:255
NWWriter_DlrNavteq::UNDEFINED
static const std::string UNDEFINED
magic value for undefined stuff
Definition: NWWriter_DlrNavteq.h:127
NBNodeCont::size
int size() const
Returns the number of nodes stored in this container.
Definition: NBNodeCont.h:263
IDSupplier::getNext
std::string getNext()
Returns the next id.
Definition: IDSupplier.cpp:51
NWWriter_DlrNavteq::getRoadClass
static int getRoadClass(NBEdge *edge)
get the navteq road class
Definition: NWWriter_DlrNavteq.cpp:292
NBEdge::getTypeID
const std::string & getTypeID() const
get ID of type
Definition: NBEdge.h:1074
StringTokenizer::getVector
std::vector< std::string > getVector()
return vector of strings
Definition: StringTokenizer.cpp:191
config.h
NWWriter_DlrNavteq::writeNodesUnsplitted
static void writeNodesUnsplitted(const OptionsCont &oc, NBNodeCont &nc, NBEdgeCont &ec, std::map< NBEdge *, std::string > &internalNodes)
Writes the nodes_unsplitted file.
Definition: NWWriter_DlrNavteq.cpp:80
SVC_TRAILER
@ SVC_TRAILER
vehicle is a large transport vehicle
Definition: SUMOVehicleClass.h:173
SVC_BUS
@ SVC_BUS
vehicle is a bus
Definition: SUMOVehicleClass.h:165
NWWriter_DlrNavteq::getSpeedCategoryUpperBound
static int getSpeedCategoryUpperBound(int kph)
get the SPEED_LIMIT as defined by elmar (upper bound of speed category)
Definition: NWWriter_DlrNavteq.cpp:363
StringTokenizer.h
OptionsCont::writeConfiguration
void writeConfiguration(std::ostream &os, const bool filled, const bool complete, const bool addComments, const bool inComment=false) const
Writes the configuration.
Definition: OptionsCont.cpp:775
SVC_MOTORCYCLE
@ SVC_MOTORCYCLE
vehicle is a motorcycle
Definition: SUMOVehicleClass.h:175
NBNode
Represents a single node (junction) during network building.
Definition: NBNode.h:67
NBNetBuilder::getNodeCont
NBNodeCont & getNodeCont()
Returns a reference to the node container.
Definition: NBNetBuilder.h:155
NBEdge::Connection
A structure which describes a connection between edges or lanes.
Definition: NBEdge.h:189
NBNode.h
Named::getID
const std::string & getID() const
Returns the id.
Definition: Named.h:76
NBEdgeCont::begin
std::map< std::string, NBEdge * >::const_iterator begin() const
Returns the pointer to the begin of the stored edges.
Definition: NBEdgeCont.h:184
NBEdge::getConnections
const std::vector< Connection > & getConnections() const
Returns the connections.
Definition: NBEdge.h:934
NBEdge::getFromNode
NBNode * getFromNode() const
Returns the origin node of the edge.
Definition: NBEdge.h:491
PositionVector::move2side
void move2side(double amount, double maxExtension=100)
move position vector to side using certain ammount
Definition: PositionVector.cpp:1103
PositionVector::push_front_noDoublePos
void push_front_noDoublePos(const Position &p)
insert in front a non double position
Definition: PositionVector.cpp:1303
Parameterised::knowsParameter
bool knowsParameter(const std::string &key) const
Returns whether the parameter is known.
Definition: Parameterised.cpp:66
NBEdge.h
Boundary::ymax
double ymax() const
Returns maximum y-coordinate.
Definition: Boundary.cpp:136
NBEdge::getLaneSpreadFunction
LaneSpreadFunction getLaneSpreadFunction() const
Returns how this edge's lanes' lateral offset is computed.
Definition: NBEdge.h:777
NWWriter_DlrNavteq.h
NBEdge::getID
const std::string & getID() const
Definition: NBEdge.h:1380
NWWriter_DlrNavteq::writeLinksUnsplitted
static void writeLinksUnsplitted(const OptionsCont &oc, NBEdgeCont &ec, std::map< NBEdge *, std::string > &internalNodes)
Writes the links_unsplitted file.
Definition: NWWriter_DlrNavteq.cpp:195