SUMO - Simulation of Urban MObility
NIImporter_ArcView.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-2018 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 /****************************************************************************/
19 // Importer for networks stored in ArcView-shape format
20 /****************************************************************************/
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #include <config.h>
27 
28 #include <string>
30 #include <utils/common/ToString.h>
34 #include <utils/geom/GeomHelper.h>
35 #include <netbuild/NBNetBuilder.h>
36 #include <netbuild/NBHelpers.h>
37 #include <netbuild/NBEdge.h>
38 #include <netbuild/NBEdgeCont.h>
39 #include <netbuild/NBTypeCont.h>
40 #include <netbuild/NBNode.h>
41 #include <netbuild/NBNodeCont.h>
45 #include "NILoader.h"
46 #include "NIImporter_ArcView.h"
47 
48 #ifdef HAVE_GDAL
49 #if __GNUC__ > 3
50 #pragma GCC diagnostic push
51 #pragma GCC diagnostic ignored "-Wpedantic"
52 #endif
53 #include <ogrsf_frmts.h>
54 #if __GNUC__ > 3
55 #pragma GCC diagnostic pop
56 #endif
57 #endif
58 
59 
60 // ===========================================================================
61 // method definitions
62 // ===========================================================================
63 // ---------------------------------------------------------------------------
64 // static methods (interface in this case)
65 // ---------------------------------------------------------------------------
66 void
68  if (!oc.isSet("shapefile-prefix")) {
69  return;
70  }
71  // check whether the correct set of entries is given
72  // and compute both file names
73  std::string dbf_file = oc.getString("shapefile-prefix") + ".dbf";
74  std::string shp_file = oc.getString("shapefile-prefix") + ".shp";
75  std::string shx_file = oc.getString("shapefile-prefix") + ".shx";
76  // check whether the files do exist
77  if (!FileHelpers::isReadable(dbf_file)) {
78  WRITE_ERROR("File not accessible: " + dbf_file);
79  }
80  if (!FileHelpers::isReadable(shp_file)) {
81  WRITE_ERROR("File not accessible: " + shp_file);
82  }
83  if (!FileHelpers::isReadable(shx_file)) {
84  WRITE_ERROR("File not accessible: " + shx_file);
85  }
86  if (MsgHandler::getErrorInstance()->wasInformed()) {
87  return;
88  }
89  // load the arcview files
90  NIImporter_ArcView loader(oc,
91  nb.getNodeCont(), nb.getEdgeCont(), nb.getTypeCont(),
92  dbf_file, shp_file, oc.getBool("speed-in-kmh"));
93  loader.load();
94 }
95 
96 
97 
98 // ---------------------------------------------------------------------------
99 // loader methods
100 // ---------------------------------------------------------------------------
102  NBNodeCont& nc,
103  NBEdgeCont& ec,
104  NBTypeCont& tc,
105  const std::string& dbf_name,
106  const std::string& shp_name,
107  bool speedInKMH)
108  : myOptions(oc), mySHPName(shp_name),
109  myNameAddition(0),
110  myNodeCont(nc), myEdgeCont(ec), myTypeCont(tc),
111  mySpeedInKMH(speedInKMH),
112  myRunningEdgeID(0),
113  myRunningNodeID(0) {
114  UNUSED_PARAMETER(dbf_name);
115 }
116 
117 
119 
120 
121 void
123 #ifdef HAVE_GDAL
124  PROGRESS_BEGIN_MESSAGE("Loading data from '" + mySHPName + "'");
125 #if GDAL_VERSION_MAJOR < 2
126  OGRRegisterAll();
127  OGRDataSource* poDS = OGRSFDriverRegistrar::Open(mySHPName.c_str(), FALSE);
128 #else
129  GDALAllRegister();
130  GDALDataset* poDS = (GDALDataset*)GDALOpenEx(mySHPName.c_str(), GDAL_OF_VECTOR | GA_ReadOnly, NULL, NULL, NULL);
131 #endif
132  if (poDS == NULL) {
133  WRITE_ERROR("Could not open shape description '" + mySHPName + "'.");
134  return;
135  }
136 
137  // begin file parsing
138  OGRLayer* poLayer = poDS->GetLayer(0);
139  poLayer->ResetReading();
140 
141  // build coordinate transformation
142  OGRSpatialReference* origTransf = poLayer->GetSpatialRef();
143  OGRSpatialReference destTransf;
144  // use wgs84 as destination
145  destTransf.SetWellKnownGeogCS("WGS84");
146  OGRCoordinateTransformation* poCT = OGRCreateCoordinateTransformation(origTransf, &destTransf);
147  if (poCT == NULL) {
148  if (myOptions.isSet("shapefile.guess-projection")) {
149  OGRSpatialReference origTransf2;
150  origTransf2.SetWellKnownGeogCS("WGS84");
151  poCT = OGRCreateCoordinateTransformation(&origTransf2, &destTransf);
152  }
153  if (poCT == 0) {
154  WRITE_WARNING("Could not create geocoordinates converter; check whether proj.4 is installed.");
155  }
156  }
157 
158  const bool saveOrigIDs = OptionsCont::getOptions().getBool("output.original-names");
159  OGRFeature* poFeature;
160  poLayer->ResetReading();
161 
162  const double nodeJoinDist = myOptions.getFloat("shapefile.node-join-dist");
163  const std::vector<std::string> params = myOptions.getStringVector("shapefile.add-params");
164 
165  int featureIndex = 0;
166  while ((poFeature = poLayer->GetNextFeature()) != NULL) {
167  // read in edge attributes
168  if (featureIndex == 0) {
169  WRITE_MESSAGE("Available fields: " + toString(getFieldNames(poFeature)));
170  }
171  std::string id, name, from_node, to_node;
172  if (!getStringEntry(poFeature, "shapefile.street-id", "LINK_ID", true, id)) {
173  WRITE_ERROR("Needed field '" + id + "' (street-id) is missing.");
174  }
175  if (id == "") {
176  id = toString(myRunningEdgeID++);
177  }
178 
179  getStringEntry(poFeature, "shapefile.name", "ST_NAME", true, name);
180  name = StringUtils::replace(name, "&", "&amp;");
181 
182  if (!getStringEntry(poFeature, "shapefile.from-id", "REF_IN_ID", true, from_node)) {
183  WRITE_ERROR("Needed field '" + from_node + "' (from node id) is missing.");
184  }
185  if (!getStringEntry(poFeature, "shapefile.to-id", "NREF_IN_ID", true, to_node)) {
186  WRITE_ERROR("Needed field '" + to_node + "' (to node id) is missing.");
187  }
188 
189  if (from_node == "" || to_node == "") {
190  from_node = toString(myRunningNodeID++);
191  to_node = toString(myRunningNodeID++);
192  }
193 
194  std::string type;
195  if (myOptions.isSet("shapefile.type-id") && poFeature->GetFieldIndex(myOptions.getString("shapefile.type-id").c_str()) >= 0) {
196  type = poFeature->GetFieldAsString(myOptions.getString("shapefile.type-id").c_str());
197  } else if (poFeature->GetFieldIndex("ST_TYP_AFT") >= 0) {
198  type = poFeature->GetFieldAsString("ST_TYP_AFT");
199  }
200  if ((type != "" || myOptions.isSet("shapefile.type-id")) && !myTypeCont.knows(type)) {
201  WRITE_WARNING("Unknown type '" + type + "' for edge '" + id + "'");
202  }
203  double width = myTypeCont.getWidth(type);
204  bool oneway = myTypeCont.knows(type) ? myTypeCont.getIsOneWay(type) : false;
205  double speed = getSpeed(*poFeature, id);
206  int nolanes = getLaneNo(*poFeature, id, speed);
207  int priority = getPriority(*poFeature, id);
208  if (nolanes <= 0 || speed <= 0) {
209  if (myOptions.getBool("shapefile.use-defaults-on-failure")) {
210  nolanes = nolanes <= 0 ? myTypeCont.getNumLanes(type) : nolanes;
211  speed = speed <= 0 ? myTypeCont.getSpeed(type) : speed;
212  } else {
213  const std::string lanesField = myOptions.isSet("shapefile.laneNumber") ? myOptions.getString("shapefile.laneNumber") : "nolanes";
214  const std::string speedField = myOptions.isSet("shapefile.speed") ? myOptions.getString("shapefile.speed") : "speed";
215  WRITE_ERROR("Required field '" + lanesField + "' or '" + speedField + "' is missing (add fields or set option --shapefile.use-defaults-on-failure).");
216  WRITE_ERROR("Available fields: " + toString(getFieldNames(poFeature)));
217  OGRFeature::DestroyFeature(poFeature);
218  return;
219  }
220  }
221  if (mySpeedInKMH) {
222  speed = speed / (double) 3.6;
223  }
224 
225 
226  // read in the geometry
227  OGRGeometry* poGeometry = poFeature->GetGeometryRef();
228  OGRwkbGeometryType gtype = poGeometry->getGeometryType();
229  if (gtype != wkbLineString && gtype != wkbLineString25D) {
230  OGRFeature::DestroyFeature(poFeature);
231  WRITE_ERROR("Road geometry must be of type 'linestring' or 'linestring25D' (found '" + toString(gtype) + "')");
232  return;
233  }
234  OGRLineString* cgeom = (OGRLineString*) poGeometry;
235  if (poCT != 0) {
236  // try transform to wgs84
237  cgeom->transform(poCT);
238  }
239 
240  PositionVector shape;
241  for (int j = 0; j < cgeom->getNumPoints(); j++) {
242  Position pos((double) cgeom->getX(j), (double) cgeom->getY(j));
244  WRITE_WARNING("Unable to project coordinates for edge '" + id + "'.");
245  }
246  shape.push_back_noDoublePos(pos);
247  }
248 
249  // build from-node
250  NBNode* from = myNodeCont.retrieve(from_node);
251  if (from == 0) {
252  Position from_pos = shape[0];
253  from = myNodeCont.retrieve(from_pos, nodeJoinDist);
254  if (from == 0) {
255  from = new NBNode(from_node, from_pos);
256  if (!myNodeCont.insert(from)) {
257  WRITE_ERROR("Node '" + from_node + "' could not be added");
258  delete from;
259  continue;
260  }
261  }
262  }
263  // build to-node
264  NBNode* to = myNodeCont.retrieve(to_node);
265  if (to == 0) {
266  Position to_pos = shape[-1];
267  to = myNodeCont.retrieve(to_pos, nodeJoinDist);
268  if (to == 0) {
269  to = new NBNode(to_node, to_pos);
270  if (!myNodeCont.insert(to)) {
271  WRITE_ERROR("Node '" + to_node + "' could not be added");
272  delete to;
273  continue;
274  }
275  }
276  }
277 
278  if (from == to) {
279  WRITE_WARNING("Edge '" + id + "' connects identical nodes, skipping.");
280  continue;
281  }
282 
283  // retrieve the information whether the street is bi-directional
284  std::string dir;
285  int index = poFeature->GetDefnRef()->GetFieldIndex("DIR_TRAVEL");
286  if (index >= 0 && poFeature->IsFieldSet(index)) {
287  dir = poFeature->GetFieldAsString(index);
288  }
289  const std::string origID = saveOrigIDs ? id : "";
290  // add positive direction if wanted
291  if (dir == "B" || dir == "F" || dir == "" || myOptions.getBool("shapefile.all-bidirectional")) {
292  if (myEdgeCont.retrieve(id) == 0) {
293  LaneSpreadFunction spread = dir == "B" || dir == "FALSE" ? LANESPREAD_RIGHT : LANESPREAD_CENTER;
294  NBEdge* edge = new NBEdge(id, from, to, type, speed, nolanes, priority, width, NBEdge::UNSPECIFIED_OFFSET, shape, name, origID, spread);
296  myEdgeCont.insert(edge);
297  checkSpread(edge);
298  addParams(edge, poFeature, params);
299  }
300  }
301  // add negative direction if wanted
302  if ((dir == "B" || dir == "T" || myOptions.getBool("shapefile.all-bidirectional")) && !oneway) {
303  if (myEdgeCont.retrieve("-" + id) == 0) {
304  LaneSpreadFunction spread = dir == "B" || dir == "FALSE" ? LANESPREAD_RIGHT : LANESPREAD_CENTER;
305  NBEdge* edge = new NBEdge("-" + id, to, from, type, speed, nolanes, priority, width, NBEdge::UNSPECIFIED_OFFSET, shape.reverse(), name, origID, spread);
307  myEdgeCont.insert(edge);
308  checkSpread(edge);
309  addParams(edge, poFeature, params);
310  }
311  }
312  //
313  OGRFeature::DestroyFeature(poFeature);
314  featureIndex++;
315  }
316 #if GDAL_VERSION_MAJOR < 2
317  OGRDataSource::DestroyDataSource(poDS);
318 #else
319  GDALClose(poDS);
320 #endif
322 #else
323  WRITE_ERROR("SUMO was compiled without GDAL support.");
324 #endif
325 }
326 
327 #ifdef HAVE_GDAL
328 double
329 NIImporter_ArcView::getSpeed(OGRFeature& poFeature, const std::string& edgeid) {
330  if (myOptions.isSet("shapefile.speed")) {
331  int index = poFeature.GetDefnRef()->GetFieldIndex(myOptions.getString("shapefile.speed").c_str());
332  if (index >= 0 && poFeature.IsFieldSet(index)) {
333  const double speed = poFeature.GetFieldAsDouble(index);
334  if (speed <= 0) {
335  WRITE_WARNING("invalid value for field: '"
336  + myOptions.getString("shapefile.laneNumber")
337  + "': '" + std::string(poFeature.GetFieldAsString(index)) + "'");
338  } else {
339  return speed;
340  }
341  }
342  }
343  if (myOptions.isSet("shapefile.type-id")) {
344  return myTypeCont.getSpeed(poFeature.GetFieldAsString((char*)(myOptions.getString("shapefile.type-id").c_str())));
345  }
346  // try to get definitions as to be found in SUMO-XML-definitions
347  // idea by John Michael Calandrino
348  int index = poFeature.GetDefnRef()->GetFieldIndex("speed");
349  if (index >= 0 && poFeature.IsFieldSet(index)) {
350  return (double) poFeature.GetFieldAsDouble(index);
351  }
352  index = poFeature.GetDefnRef()->GetFieldIndex("SPEED");
353  if (index >= 0 && poFeature.IsFieldSet(index)) {
354  return (double) poFeature.GetFieldAsDouble(index);
355  }
356  // try to get the NavTech-information
357  index = poFeature.GetDefnRef()->GetFieldIndex("SPEED_CAT");
358  if (index >= 0 && poFeature.IsFieldSet(index)) {
359  std::string def = poFeature.GetFieldAsString(index);
360  return NINavTeqHelper::getSpeed(edgeid, def);
361  }
362  return -1;
363 }
364 
365 
366 int
367 NIImporter_ArcView::getLaneNo(OGRFeature& poFeature, const std::string& edgeid,
368  double speed) {
369  if (myOptions.isSet("shapefile.laneNumber")) {
370  int index = poFeature.GetDefnRef()->GetFieldIndex(myOptions.getString("shapefile.laneNumber").c_str());
371  if (index >= 0 && poFeature.IsFieldSet(index)) {
372  const int laneNumber = poFeature.GetFieldAsInteger(index);
373  if (laneNumber <= 0) {
374  WRITE_WARNING("invalid value for field '"
375  + myOptions.getString("shapefile.laneNumber")
376  + "': '" + std::string(poFeature.GetFieldAsString(index)) + "'");
377  } else {
378  return laneNumber;
379  }
380  }
381  }
382  if (myOptions.isSet("shapefile.type-id")) {
383  return (int) myTypeCont.getNumLanes(poFeature.GetFieldAsString((char*)(myOptions.getString("shapefile.type-id").c_str())));
384  }
385  // try to get definitions as to be found in SUMO-XML-definitions
386  // idea by John Michael Calandrino
387  int index = poFeature.GetDefnRef()->GetFieldIndex("nolanes");
388  if (index >= 0 && poFeature.IsFieldSet(index)) {
389  return (int) poFeature.GetFieldAsInteger(index);
390  }
391  index = poFeature.GetDefnRef()->GetFieldIndex("NOLANES");
392  if (index >= 0 && poFeature.IsFieldSet(index)) {
393  return (int) poFeature.GetFieldAsInteger(index);
394  }
395  index = poFeature.GetDefnRef()->GetFieldIndex("rnol");
396  if (index >= 0 && poFeature.IsFieldSet(index)) {
397  return (int) poFeature.GetFieldAsInteger(index);
398  }
399  index = poFeature.GetDefnRef()->GetFieldIndex("LANE_CAT");
400  if (index >= 0 && poFeature.IsFieldSet(index)) {
401  std::string def = poFeature.GetFieldAsString(index);
402  return NINavTeqHelper::getLaneNumber(edgeid, def, speed);
403  }
404  return 0;
405 }
406 
407 
408 int
409 NIImporter_ArcView::getPriority(OGRFeature& poFeature, const std::string& /*edgeid*/) {
410  if (myOptions.isSet("shapefile.type-id")) {
411  return myTypeCont.getPriority(poFeature.GetFieldAsString((char*)(myOptions.getString("shapefile.type-id").c_str())));
412  }
413  // try to get definitions as to be found in SUMO-XML-definitions
414  // idea by John Michael Calandrino
415  int index = poFeature.GetDefnRef()->GetFieldIndex("priority");
416  if (index >= 0 && poFeature.IsFieldSet(index)) {
417  return poFeature.GetFieldAsInteger(index);
418  }
419  index = poFeature.GetDefnRef()->GetFieldIndex("PRIORITY");
420  if (index >= 0 && poFeature.IsFieldSet(index)) {
421  return poFeature.GetFieldAsInteger(index);
422  }
423  // try to determine priority from NavTechs FUNC_CLASS attribute
424  index = poFeature.GetDefnRef()->GetFieldIndex("FUNC_CLASS");
425  if (index >= 0 && poFeature.IsFieldSet(index)) {
426  return poFeature.GetFieldAsInteger(index);
427  }
428  return 0;
429 }
430 
431 void
432 NIImporter_ArcView::checkSpread(NBEdge* e) {
433  NBEdge* ret = e->getToNode()->getConnectionTo(e->getFromNode());
434  if (ret != 0) {
437  }
438 }
439 
440 bool
441 NIImporter_ArcView::getStringEntry(OGRFeature* poFeature, const std::string& optionName, const char* defaultName, bool prune, std::string& into) {
442  std::string v(defaultName);
443  if (myOptions.isSet(optionName)) {
444  v = myOptions.getString(optionName);
445  }
446  if (poFeature->GetFieldIndex(v.c_str()) < 0) {
447  if (myOptions.isSet(optionName)) {
448  into = v;
449  return false;
450  }
451  into = "";
452  return true;
453  }
454  into = poFeature->GetFieldAsString((char*)v.c_str());
455  if (prune) {
456  into = StringUtils::prune(into);
457  }
458  return true;
459 }
460 
461 std::vector<std::string>
462 NIImporter_ArcView::getFieldNames(OGRFeature* poFeature) const {
463  std::vector<std::string> fields;
464  for (int i = 0; i < poFeature->GetFieldCount(); i++) {
465  fields.push_back(poFeature->GetFieldDefnRef(i)->GetNameRef());
466  }
467  return fields;
468 }
469 
470 void
471 NIImporter_ArcView::addParams(NBEdge* edge, OGRFeature* poFeature, const std::vector<std::string>& params) const {
472  for (const std::string& p : params) {
473  int index = poFeature->GetDefnRef()->GetFieldIndex(p.c_str());
474  if (index >= 0 && poFeature->IsFieldSet(index)) {
475  edge->setParameter(p, poFeature->GetFieldAsString(index));
476  }
477  }
478 }
479 
480 #endif
481 
482 
483 
484 /****************************************************************************/
485 
NBNode * retrieve(const std::string &id) const
Returns the node with the given name.
Definition: NBNodeCont.cpp:108
int myNameAddition
A running number to assure unique edge ids.
static MsgHandler * getErrorInstance()
Returns the instance to add errors to.
Definition: MsgHandler.cpp:76
double getSpeed(const std::string &type) const
Returns the maximal velocity for the given type [m/s].
Definition: NBTypeCont.cpp:174
NBTypeCont & getTypeCont()
Returns a reference to the type container.
Definition: NBNetBuilder.h:160
~NIImporter_ArcView()
Destructor.
static bool transformCoordinate(Position &from, bool includeInBoundary=true, GeoConvHelper *from_srs=0)
transforms loaded coordinates handles projections, offsets (using GeoConvHelper) and import of height...
static bool isReadable(std::string path)
Checks whether the given file is readable.
Definition: FileHelpers.cpp:47
static double getSpeed(const std::string &id, const std::string &speedClassS)
Returns the speed evaluating the given Navteq-description.
std::string mySHPName
The name of the shape file.
NBTypeCont & myTypeCont
The container to get the types from.
The representation of a single edge during network building.
Definition: NBEdge.h:65
static void loadNetwork(const OptionsCont &oc, NBNetBuilder &nb)
Loads content of the optionally given ArcView Shape files.
int getPriority(const std::string &type) const
Returns the priority for the given type.
Definition: NBTypeCont.cpp:180
const OptionsCont & myOptions
The options to use.
static const double UNSPECIFIED_OFFSET
unspecified lane offset
Definition: NBEdge.h:259
void setPermissions(SVCPermissions permissions, int lane=-1)
set allowed/disallowed classes for the given lane or for all lanes if -1 is given ...
Definition: NBEdge.cpp:3271
void load()
Loads the shape files.
PositionVector reverse() const
reverse position vector
int getNumLanes(const std::string &type) const
Returns the number of lanes for the given type.
Definition: NBTypeCont.cpp:168
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
#define UNUSED_PARAMETER(x)
Definition: StdDefs.h:33
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:242
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:58
double getWidth(const std::string &type) const
Returns the lane width for the given type [m].
Definition: NBTypeCont.cpp:210
NBEdge * getConnectionTo(NBNode *n) const
get connection to certain node
Definition: NBNode.cpp:1929
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
bool knows(const std::string &type) const
Returns whether the named type is in the container.
Definition: NBTypeCont.cpp:68
bool insert(NBEdge *edge, bool ignorePrunning=false)
Adds an edge to the dictionary.
Definition: NBEdgeCont.cpp:152
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:49
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
NBEdgeCont & getEdgeCont()
Definition: NBNetBuilder.h:150
A list of positions.
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:61
std::vector< std::string > getStringVector(const std::string &name) const
Returns the list of string-vector-value of the named option (only for Option_String) ...
Importer for networks stored in ArcView-shape format.
#define PROGRESS_BEGIN_MESSAGE(msg)
Definition: MsgHandler.h:244
void setParameter(const std::string &key, const std::string &value)
Sets a parameter.
double getFloat(const std::string &name) const
Returns the double-value of the named option (only for Option_Float)
#define WRITE_ERROR(msg)
Definition: MsgHandler.h:248
static std::string replace(std::string str, const char *what, const char *by)
NIImporter_ArcView(const OptionsCont &oc, NBNodeCont &nc, NBEdgeCont &ec, NBTypeCont &tc, const std::string &dbf_name, const std::string &shp_name, bool speedInKMH)
Constructor.
static std::string prune(const std::string &str)
Removes trailing and leading whitechars.
Definition: StringUtils.cpp:45
NBNodeCont & getNodeCont()
Returns a reference to the node container.
Definition: NBNetBuilder.h:155
Instance responsible for building networks.
Definition: NBNetBuilder.h:109
NBNodeCont & myNodeCont
The container to add nodes to.
NBEdge * retrieve(const std::string &id, bool retrieveExtracted=false) const
Returns the edge that has the given id.
Definition: NBEdgeCont.cpp:245
A storage for options typed value containers)
Definition: OptionsCont.h:92
bool insert(const std::string &id, const Position &position, NBDistrict *district=0)
Inserts a node into the map.
Definition: NBNodeCont.cpp:79
LaneSpreadFunction
Numbers representing special SUMO-XML-attribute values Information how the edge&#39;s lateral offset shal...
int myRunningEdgeID
A running number to assure unique ids (as fallback)
Represents a single node (junction) during network building.
Definition: NBNode.h:68
static int getLaneNumber(const std::string &id, const std::string &laneNoS, double speed)
Returns the lane number evaluating the given Navteq-description.
void push_back_noDoublePos(const Position &p)
insert in back a non double position
NBNode * getFromNode() const
Returns the origin node of the edge.
Definition: NBEdge.h:432
Container for nodes during the netbuilding process.
Definition: NBNodeCont.h:60
NBEdgeCont & myEdgeCont
The container to add edges to.
#define PROGRESS_DONE_MESSAGE()
Definition: MsgHandler.h:245
bool getIsOneWay(const std::string &type) const
Returns whether edges are one-way per default for the given type.
Definition: NBTypeCont.cpp:186
void setLaneSpreadFunction(LaneSpreadFunction spread)
(Re)sets how the lanes lateral offset shall be computed
Definition: NBEdge.cpp:829
#define WRITE_MESSAGE(msg)
Definition: MsgHandler.h:243
NBNode * getToNode() const
Returns the destination node of the edge.
Definition: NBEdge.h:439
bool mySpeedInKMH
Whether the speed is given in km/h.
SVCPermissions getPermissions(const std::string &type) const
Returns allowed vehicle classes for the given type.
Definition: NBTypeCont.cpp:204
A storage for available types of edges.
Definition: NBTypeCont.h:55