43 {
"VSYS", VISUM_SYS },
44 {
"STRECKENTYP", VISUM_LINKTYPE },
45 {
"KNOTEN", VISUM_NODE },
46 {
"BEZIRK", VISUM_DISTRICT },
47 {
"PUNKT", VISUM_POINT },
48 {
"STRECKE", VISUM_LINK },
50 {
"VSYSSET", VISUM_TYPES },
51 {
"RANG", VISUM_RANK },
52 {
"KAPIV", VISUM_CAPACITY },
53 {
"XKOORD", VISUM_XCOORD },
54 {
"YKOORD", VISUM_YCOORD },
56 {
"CODE", VISUM_CODE },
57 {
"VONKNOTNR", VISUM_FROMNODE },
58 {
"NACHKNOTNR", VISUM_TONODE },
59 {
"TYPNR", VISUM_TYPE },
61 {
"ANBINDUNG", VISUM_DISTRICT_CONNECTION },
62 {
"BEZNR", VISUM_SOURCE_DISTRICT },
63 {
"KNOTNR", VISUM_FROMNODENO },
64 {
"RICHTUNG", VISUM_DIRECTION },
65 {
"FLAECHEID", VISUM_SURFACEID },
66 {
"TFLAECHEID", VISUM_FACEID },
67 {
"VONPUNKTID", VISUM_FROMPOINTID },
68 {
"NACHPUNKTID", VISUM_TOPOINTID },
69 {
"KANTE", VISUM_EDGE },
70 {
"ABBIEGER", VISUM_TURN },
71 {
"UEBERKNOTNR", VISUM_VIANODENO },
72 {
"ANZFAHRSTREIFEN", VISUM_NUMLANES },
73 {
"INDEX", VISUM_INDEX },
74 {
"STRECKENPOLY", VISUM_LINKPOLY },
75 {
"FLAECHENELEMENT", VISUM_SURFACEITEM },
76 {
"TEILFLAECHENELEMENT", VISUM_FACEITEM },
77 {
"KANTEID", VISUM_EDGEID },
78 {
"Q", VISUM_ORIGIN },
79 {
"Z", VISUM_DESTINATION },
80 {
"HALTEPUNKT", VISUM_STOPPOINT },
81 {
"NAME", VISUM_NAME },
82 {
"STRNR", VISUM_LINKNO },
83 {
"RELPOS", VISUM_RELPOS },
84 {
"KATNR", VISUM_CATID },
85 {
"ZWISCHENPUNKT", VISUM_EDGEITEM },
86 {
"POIKATEGORIE", VISUM_POICATEGORY },
87 {
"NETZ", VISUM_NETWORK },
88 {
"DEFKOORD", VISUM_PROJECTIONDEFINITION },
106 if (!oc.
isSet(
"visum-file")) {
112 oc.
getBool(
"visum.use-type-priority"),
115 std::vector<std::string> codes;
117 codes.push_back(it->first);
119 for (
const std::string& code : codes) {
131 const std::string& file,
134 const std::string& languageFile) :
137 if (languageFile !=
"") {
201 for (NIVisumTL_Map::iterator j =
myTLS.begin(); j !=
myTLS.end(); j++) {
226 if (line.length() > 0 && line[0] ==
'$') {
227 ParserVector::iterator i;
229 std::string dataName =
"$" + (*i).name +
":";
230 if (line.substr(0, dataName.length()) == dataName) {
232 (*i).pattern = line.substr(dataName.length());
240 if ((*i).position < 0) {
252 bool singleDataEndFound =
false;
255 if (line.length() == 0 || line[0] ==
'*' || line[0] ==
'$') {
256 singleDataEndFound =
true;
261 (this->*(*i).function)();
263 WRITE_ERRORF(
TL(
"Too short value line in % occurred."), (*i).name);
267 WRITE_ERRORF(
TL(
"One of the needed values ('%') is missing in %."), std::string(e.what()), (*i).name);
274 myNetBuilder.getEdgeCont().reduceGeometries(POSITION_EPS);
277 for (NIVisumTL_Map::iterator j =
myTLS.begin(); j !=
myTLS.end(); j++) {
282 (*k).first->addShape((*k).second);
305 GeoConvHelper* result =
new GeoConvHelper(proj,
Position(0, 0),
Boundary(0, 0, 1, 1),
Boundary(0, 0, 1, 1));
320 }
else if (speed < 0) {
384 long long int flaecheID;
426 double speed =
myNetBuilder.getTypeCont().getEdgeTypeSpeed(type);
430 if (speedS.find(
"km/h") != std::string::npos) {
431 speedS = speedS.substr(0, speedS.find(
"km/h"));
437 speed =
myNetBuilder.getTypeCont().getEdgeTypeSpeed(type);
441 int nolanes =
myNetBuilder.getTypeCont().getEdgeTypeNumLanes(type);
459 bool oneway_checked =
true;
461 if (previous !=
nullptr) {
464 oneway_checked =
false;
467 oneway_checked =
false;
472 if (previous !=
nullptr) {
475 oneway_checked =
false;
481 if (nolanes != 0 && speed != 0) {
500 myEdges[id] = std::make_pair(from, to);
521 if (dest ==
nullptr) {
531 if (dir.length() == 0) {
537 myNetBuilder.getDistrictCont().addSource(bez, edge, proz);
543 myNetBuilder.getDistrictCont().addSink(bez, edge, proz);
556 if (dest ==
nullptr) {
576 std::string
id = bez +
"-" + dest->
getID();
579 if (dir.length() == 0) {
585 bool hasContinuation =
false;
586 for (EdgeVector::const_iterator i = edges.begin(); i != edges.end(); ++i) {
587 if (!(*i)->isMacroscopicConnector()) {
588 hasContinuation =
true;
591 if (!hasContinuation) {
593 WRITE_WARNINGF(
TL(
"Incoming connector '%' will not be build - would be not connected to network."),
id);
596 if (src ==
nullptr) {
600 NBEdge* edge =
new NBEdge(
id, src, dest,
"VisumConnector",
611 if (edge !=
nullptr) {
612 myNetBuilder.getDistrictCont().addSource(bez, edge, proz);
619 bool hasPredeccessor =
false;
620 for (EdgeVector::const_iterator i = edges.begin(); i != edges.end(); ++i) {
621 if (!(*i)->isMacroscopicConnector()) {
622 hasPredeccessor =
true;
625 if (!hasPredeccessor) {
627 WRITE_WARNINGF(
TL(
"Outgoing connector '%' will not be build - would be not connected to network."),
id);
630 if (src ==
nullptr) {
635 NBEdge* edge =
new NBEdge(
id, dest, src,
"VisumConnector",
646 if (edge !=
nullptr) {
647 myNetBuilder.getDistrictCont().addSink(bez, edge, proz);
664 if (from ==
nullptr || via ==
nullptr || to ==
nullptr) {
677 if (src ==
nullptr) {
683 if (dest ==
nullptr) {
748 if (baseEdge ==
nullptr) {
754 if (node ==
nullptr) {
760 if (edge ==
nullptr) {
795 WRITE_ERRORF(
TL(
"A lane length for edge '%' is not numeric (%)."), edge->
getID(), lengthS);
799 WRITE_ERRORF(
TL(
"A lane length for edge '%' is not positive (%)."), edge->
getID(), lengthS);
829 bool mustRecheck =
true;
830 double seenLength = 0;
831 while (mustRecheck) {
834 std::string sub = edge->
getID();
835 sub = sub.substr(sub.rfind(
'_', sub.rfind(
'_') - 1));
836 sub = sub.substr(1, sub.find(
'_', 1) - 1);
857 double useLength = length - seenLength;
858 useLength = edge->
getLength() - useLength;
859 if (useLength < 0 || useLength > edge->
getLength()) {
863 std::string edgeID = edge->
getID();
866 edgeID = edgeID.substr(0, edgeID.find(
'_'));
872 std::string nid = edgeID +
"_" +
toString((
int) length) +
"_" + node->
getID();
909 std::string trafficLight =
myLineParser.get(
"LsaNr").c_str();
912 auto tlIt =
myTLS.find(trafficLight);
913 if (
n !=
nullptr && tlIt !=
myTLS.end()) {
914 tlIt->second->addNode(
n);
916 WRITE_ERROR(
"Could not assign" + std::string(
n ==
nullptr ?
" missing" :
"") +
" node '" + node
917 +
"' to" + std::string(tlIt ==
myTLS.end() ?
" missing" :
"") +
" traffic light '" + trafficLight +
"'");
931 WRITE_ERRORF(
TL(
"Could not find TLS '%' for setting the signal group."), LSAid);
934 myTLS.find(LSAid)->second->addSignalGroup(
myCurrentID, startTime, endTime, yellowTime);
944 WRITE_WARNING(
TL(
"Ignoring SIGNALGRUPPEZUFSABBIEGER because LsaNr is not known"));
957 if (from ==
nullptr && to ==
nullptr) {
966 if (edg1 !=
nullptr && edg2 !=
nullptr) {
969 if (edg1->
getID()[0] ==
'-') {
970 sid = edg1->
getID().substr(1);
972 sid =
"-" + edg1->
getID();
974 if (sid.find(
'_') != std::string::npos) {
975 sid = sid.substr(0, sid.find(
'_'));
981 if (edg2->
getID()[0] ==
'-') {
982 sid = edg2->
getID().substr(1);
984 sid =
"-" + edg2->
getID();
986 if (sid.find(
'_') != std::string::npos) {
987 sid = sid.substr(0, sid.find(
'_'));
1017 if (dir.length() > 0 && dir[0] ==
'1') {
1025 const std::vector<long long int>& areas =
mySubPartsAreas.find(
id)->second;
1026 for (std::vector<long long int>::const_iterator i = areas.begin(); i != areas.end(); ++i) {
1034 if (dir.length() > 0 && dir[0] ==
'1') {
1053 myTLS.find(LSAid)->second->addPhase(phaseid, startTime, endTime, yellowTime);
1066 SG.
phases()[Phaseid] = PH;
1072 NBEdge* fromEdge =
nullptr;
1073 NBEdge* toEdge =
nullptr;
1076 if (nodeID ==
"0") {
1079 if (fromEdge ==
nullptr) {
1083 WRITE_WARNING(
TL(
"Ignoring lane-to-lane connection (not yet implemented for this format version)"));
1087 if (node ==
nullptr) {
1093 if (fromEdge ==
nullptr || toEdge ==
nullptr) {
1097 int fromLaneOffset = 0;
1107 int toLaneOffset = 0;
1121 WRITE_ERRORF(
TL(
"A from-lane number for edge '%' is not numeric (%)."), fromEdge->
getID(), fromLaneS);
1126 WRITE_ERRORF(
TL(
"A from-lane number for edge '%' is not positive (%)."), fromEdge->
getID(), fromLaneS);
1135 WRITE_ERRORF(
TL(
"A to-lane number for edge '%' is not numeric (%)."), toEdge->
getID(), toLaneS);
1140 WRITE_ERRORF(
TL(
"A to-lane number for edge '%' is not positive (%)."), toEdge->
getID(), toLaneS);
1144 if (fromLane - fromLaneOffset < 0) {
1147 fromLane = (int)fromEdge->
getNumLanes() - (fromLane - fromLaneOffset) - 1;
1149 if (toLane - toLaneOffset < 0) {
1152 toLane = (int)toEdge->
getNumLanes() - (toLane - toLaneOffset) - 1;
1156 WRITE_ERRORF(
TL(
"A from-lane number for edge '%' is larger than the edge's lane number (%)."), fromEdge->
getID(), fromLaneS);
1160 WRITE_ERRORF(
TL(
"A to-lane number for edge '%' is larger than the edge's lane number (%)."), toEdge->
getID(), toLaneS);
1177 }
else if (from ==
nullptr && to ==
nullptr) {
1178 WRITE_WARNINGF(
TL(
"Ignoring stopping place '%' without node information"),
id);
1181 if (edge ==
nullptr) {
1182 WRITE_WARNINGF(
TL(
"Ignoring stopping place '%' with invalid edge reference '%'"),
id, edgeID);
1184 }
else if (from !=
nullptr) {
1187 if (edge2 ==
nullptr) {
1188 WRITE_WARNINGF(
TL(
"Could not find edge with from-node '%' and base id '%' for stopping place '%'"), from->
getID(), edge->
getID(),
id);
1198 if (edge2 ==
nullptr) {
1199 WRITE_WARNINGF(
TL(
"Could not find edge with to-node '%' and base id '%' for stopping place '%'"), to->
getID(), edge->
getID(),
id);
1213 std::shared_ptr<NBPTStop> ptStop = std::make_shared<NBPTStop>(element,
id, pos, edge->
getID(), edge->
getID(), length, name, permissions);
1223 if (val.find(suffix) != std::string::npos) {
1224 val = val.substr(0, val.find(suffix));
1263 }
else if (tc.
knows(v4)) {
1270 desc = it->second.name;
1271 if (desc.find(
"taxi") != std::string::npos) {
1273 }
else if (desc.find(
"bus") != std::string::npos) {
1275 }
else if (desc.find(
"seilbahn") != std::string::npos || desc.find(
"funiculaire") != std::string::npos || desc.find(
"cable") != std::string::npos || desc.find(
"funicular") != std::string::npos) {
1277 }
else if (desc.find(
"subway") != std::string::npos || desc.find(
"ubahn") != std::string::npos || desc.find(
"u-bahn") != std::string::npos) {
1279 }
else if (desc.find(
"train") != std::string::npos || desc.find(
"schiene") != std::string::npos || desc.find(
"rail") != std::string::npos || desc.find(
"bahn") != std::string::npos || desc.find(
"zug") != std::string::npos) {
1281 }
else if (desc.find(
"tram") != std::string::npos || desc.find(
"strab") != std::string::npos) {
1283 }
else if (desc.find(
"moto") != std::string::npos) {
1285 }
else if (desc.find(
"bike") != std::string::npos || desc.find(
"velo") != std::string::npos || desc.find(
"bicycle") != std::string::npos || desc.find(
"rad") != std::string::npos) {
1287 }
else if (desc.find(
"foot") != std::string::npos || desc.find(
"ped") != std::string::npos || desc.find(
"fu\xdf") != std::string::npos
1288 || desc.find(
"fuss") != std::string::npos || desc.find(
"walk") != std::string::npos || desc.find(
"pied") != std::string::npos) {
1290 }
else if (desc.find(
"lkw") != std::string::npos || desc.find(
"truck") != std::string::npos || desc.find(
"camion") != std::string::npos) {
1292 }
else if (desc.find(
"pkw") != std::string::npos || desc.find(
"car") != std::string::npos || desc.find(
"auto") != std::string::npos) {
1297 WRITE_WARNINGF(
"Encountered unknown vehicle category '%' in type '%' (description: '%')", v3, edgeType, desc);
1302 tc.
insertEdgeType(v4, 1, 1, -1, guessed,
LaneSpreadFunction::RIGHT,
NBEdge::UNSPECIFIED_WIDTH,
false,
NBEdge::UNSPECIFIED_WIDTH,
NBEdge::UNSPECIFIED_WIDTH, 0, 0, 0);
1313 if (node ==
nullptr) {
1323 if (node ==
nullptr) {
1344 if (edge ==
nullptr) {
1365 if (edge->
getID()[0] ==
'-') {
1366 sid = edge->
getID().substr(1);
1368 sid =
"-" + edge->
getID();
1370 if (sid.find(
'_') != std::string::npos) {
1371 sid = sid.substr(0, sid.find(
'_'));
1379 if (begin ==
nullptr) {
1383 std::string edgeID = ret->
getID();
1385 while (ret !=
nullptr) {
1391 if (nedges.size() != 1) {
1396 NBEdge* next = nedges[0];
1397 if (ret->
getID().substr(0, edgeID.length()) != next->
getID().substr(0, edgeID.length())) {
1411 while (ret !=
nullptr) {
1417 if (nedges.size() != 1) {
1422 NBEdge* next = nedges[0];
1423 if (ret->
getID().substr(0, edgeID.length()) != next->
getID().substr(0, edgeID.length())) {
1442 if (edge ==
nullptr) {
1462 EdgeVector::const_iterator i;
1464 if (ToNode == (*i)->getToNode()) {
1488 return defaultValue;
1505 double defaultValue) {
1522 const std::string& fieldName2) {
1540 if (dist ==
nullptr) {
1545 nid =
id +
"-" + dest->
getID();
1560 if (from ==
nullptr) {
1561 WRITE_ERROR(
TL(
" The from-node was not found within the net"));
1563 if (to ==
nullptr) {
1564 WRITE_ERROR(
TL(
" The to-node was not found within the net"));
1569 return from !=
nullptr && to !=
nullptr && from != to;
1574 return (edge->
getID().length() > node->
getID().length() + 1
1575 && (edge->
getID().substr(edge->
getID().length() - node->
getID().length() - 1) ==
"_" + node->
getID()));
1580 std::ifstream strm(file.c_str());
1582 throw ProcessError(
TLF(
"Could not load VISUM language map from '%'.", file));
1584 while (strm.good()) {
1589 if (
KEYS.hasString(keyDE)) {
1591 KEYS.remove(keyDE, key);
1592 KEYS.insert(keyNew, key);
1593 }
else if (keyDE !=
"") {
#define WRITE_WARNINGF(...)
#define WRITE_ERRORF(...)
#define WRITE_MESSAGE(msg)
#define WRITE_WARNING(msg)
#define PROGRESS_DONE_MESSAGE()
#define PROGRESS_BEGIN_MESSAGE(msg)
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
const std::string invalid_return< std::string >::value
bool isRailway(SVCPermissions permissions)
Returns whether an edge with the given permissions is a (exclusive) railway edge.
const std::string & getVehicleClassNames(SVCPermissions permissions, bool expand)
Returns the ids of the given classes, divided using a ' '.
SVCPermissions parseVehicleClasses(const std::string &allowedS)
Parses the given definition of allowed vehicle classes into the given containers Deprecated classes g...
long long int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
@ SVC_TRUCK
vehicle is a large transport vehicle
@ SVC_IGNORING
vehicles ignoring classes
@ SVC_RAIL
vehicle is a not electrified rail
@ SVC_PASSENGER
vehicle is a passenger car (a "normal" car)
@ SVC_BICYCLE
vehicle is a bicycle
@ SVC_MOTORCYCLE
vehicle is a motorcycle
@ SVC_TRAM
vehicle is a light rail
@ SVC_TAXI
vehicle is a taxi
@ SVC_BUS
vehicle is a bus
@ SVC_PEDESTRIAN
pedestrian
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ SUMO_TAG_BUS_STOP
A bus stop.
@ SUMO_TAG_TRAIN_STOP
A train stop (alias for bus stop).
LaneSpreadFunction
Numbers representing special SUMO-XML-attribute values Information how the edge's lateral offset shal...
@ SUMO_ATTR_SPREADTYPE
The information about how to spread the lanes from the given position.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
A class that stores a 2D geometrical boundary.
static methods for processing the coordinates conversion for the current net
static void setLoaded(const GeoConvHelper &loaded)
sets the coordinate transformation loaded from a location element
A helper class which computes the lane number from given capacity.
A class representing a single district.
const Position & getPosition() const
Returns the position of this district's center.
The representation of a single edge during network building.
void addGeometryPoint(int index, const Position &p)
Adds a further geometry point.
double getLength() const
Returns the computed length of the edge.
void setPermissions(SVCPermissions permissions, int lane=-1)
set allowed/disallowed classes for the given lane or for all lanes if -1 is given
NBNode * getToNode() const
Returns the destination node of the edge.
static const double UNSPECIFIED_FRICTION
unspecified lane friction
void incLaneNo(int by)
increment lane
const PositionVector & getGeometry() const
Returns the geometry of the edge.
bool addEdge2EdgeConnection(NBEdge *dest, bool overrideRemoval=false, SVCPermissions permission=SVC_UNSPECIFIED)
Adds a connection to another edge.
bool addLane2LaneConnection(int fromLane, NBEdge *dest, int toLane, Lane2LaneInfoType type, bool mayUseSameDestination=false, bool mayDefinitelyPass=false, KeepClear keepClear=KEEPCLEAR_UNSPECIFIED, double contPos=UNSPECIFIED_CONTPOS, double visibility=UNSPECIFIED_VISIBILITY_DISTANCE, double speed=UNSPECIFIED_SPEED, double friction=UNSPECIFIED_FRICTION, double length=myDefaultConnectionLength, const PositionVector &customShape=PositionVector::EMPTY, const bool uncontrolled=UNSPECIFIED_CONNECTION_UNCONTROLLED, SVCPermissions permissions=SVC_UNSPECIFIED, const bool indirectLeft=false, const std::string &edgeType="", SVCPermissions changeLeft=SVC_UNSPECIFIED, SVCPermissions changeRight=SVC_UNSPECIFIED, bool postProcess=false)
Adds a connection between the specified this edge's lane and an approached one.
const std::string & getID() const
void setLaneSpreadFunction(LaneSpreadFunction spread)
(Re)sets how the lanes lateral offset shall be computed
int getNumLanes() const
Returns the number of lanes.
@ VALIDATED
The connection was computed and validated.
NBNode * getFromNode() const
Returns the origin node of the edge.
static const double UNSPECIFIED_WIDTH
unspecified lane width
static const double UNSPECIFIED_OFFSET
unspecified lane offset
void setAsMacroscopicConnector()
static std::string normalIDRepresentation(const std::string &id)
converts the numerical id to its "normal" string representation
Instance responsible for building networks.
NBTypeCont & getTypeCont()
Returns a reference to the type container.
static bool transformCoordinate(Position &from, bool includeInBoundary=true, GeoConvHelper *from_srs=nullptr)
transforms loaded coordinates handles projections, offsets (using GeoConvHelper) and import of height...
Represents a single node (junction) during network building.
bool hasIncoming(const NBEdge *const e) const
Returns whether the given edge ends at this node.
const EdgeVector & getIncomingEdges() const
Returns this node's incoming edges (The edges which yield in this node).
const EdgeVector & getOutgoingEdges() const
Returns this node's outgoing edges (The edges which start at this node).
bool hasOutgoing(const NBEdge *const e) const
Returns whether the given edge starts at this node.
NBEdge * getConnectionTo(NBNode *n) const
get connection to certain node
A storage for available edgeTypes of edges.
void insertEdgeType(const std::string &id, int numLanes, double maxSpeed, int prio, SVCPermissions permissions, LaneSpreadFunction spreadType, double width, bool oneWayIsDefault, double sidewalkWidth, double bikeLaneWidth, double widthResolution, double maxWidth, double minWidth)
Adds a edgeType into the list.
TypesCont::const_iterator begin() const
return begin iterator
SVCPermissions getEdgeTypePermissions(const std::string &edgeType) const
Returns allowed vehicle classes for the given edgeType.
bool knows(const std::string &edgeType) const
Returns whether the named edgeType is in the container.
TypesCont::const_iterator end() const
return end iterator
void updateEdgeTypeID(const std::string &oldId, const std::string &newId)
change edge type ID
void load()
Parses the VISUM-network file storing the parsed structures within myNetBuilder.
void parse_Phases()
Parses LSAPHASE/PHASE.
NBCapacity2Lanes myCapacity2Lanes
The converter to compute the lane number of edges from their capacity.
static StringBijection< VISUM_KEY > KEYS
link directions
NBNetBuilder & myNetBuilder
The network builder to fill with loaded values.
SVCPermissions myDefaultPermissions
void parse_Edges()
Parses STRECKE/STRECKEN.
double getWeightedFloat2(const std::string &name, const std::string &name2, const std::string &suffix)
as above but with two alternative names
~NIImporter_VISUM()
destructor
std::vector< std::string > myTouchedEdges
Already read edges.
void(NIImporter_VISUM::* ParsingFunction)()
Definition of a function for parsing a single line from a certain db.
NBEdge * getNamedEdge(const std::string &fieldName)
Tries to get the edge which name is stored in the given field.
double getWeightedFloat(const std::string &name, const std::string &suffix)
tries to get a double which is possibly assigned to a certain modality
void parse_VSysTypes()
Parses VSYS.
void parse_NodesToTrafficLights()
Parses KNOTENZULSA/SIGNALANLAGEZUKNOTEN.
void parse_PartOfArea()
Parses FLAECHENELEMENT.
void parse_Network()
Parses meta data (i.e. projection).
void parse_TrafficLights()
Parses LSA/SIGNALANLAGE.
void parse_Connectors_legacy()
NBNode * getNamedNodeSecure(const std::string &fieldName, NBNode *fallback=0)
void parse_Point()
Parses PUNKT.
void parse_Districts()
Parses BEZIRK.
VSysTypeNames myVSysTypes
The used vsystypes.
std::string myCurrentID
The name of the currently parsed item used for error reporting.
bool getWeightedBool(const std::string &name)
tries to get a bool which is possibly assigned to a certain modality
void parse_stopPoints()
Parses HALTEPUNKT (public transport stop locations).
std::map< NBDistrict *, PositionVector > myDistrictShapes
A temporary storage for district shapes as they are filled incrementally.
std::string myFileName
The name of the parsed file, for error reporting.
std::map< long long int, Position > myPoints
A map of point ids to positions.
void addParser(const std::string &name, ParsingFunction function)
Adds a parser into the sorted list of parsers to use.
static void loadNetwork(const OptionsCont &oc, NBNetBuilder &nb)
Loads network definition from the assigned option and stores it in the given network builder.
NIImporter_VISUM(NBNetBuilder &nb, const std::string &file, NBCapacity2Lanes capacity2Lanes, bool useVisumPrio, const std::string &languageFile)
constructor
static StringBijection< VISUM_KEY >::Entry KEYS_DE[]
Strings for the keywords.
std::map< long long int, std::pair< long long int, long long int > > myEdges
A map of edge (not road, but "edge" in this case) ids to from/to-points.
void parse_EdgePolys()
Parses STRECKENPOLY.
LineReader myLineReader
The line reader to use to read from the file.
bool myUseVisumPrio
Information whether VISUM priority information shall be used.
SVCPermissions getPermissions(const std::string &name, const std::string &edgeType, SVCPermissions unknown)
parse permissions
void loadLanguage(const std::string &file)
bool checkNodes(NBNode *from, NBNode *to)
Returns whether both nodes are a valid combination of from/to-nodes.
NBEdge * getReversedContinuating(NBEdge *edge, NBNode *node)
Returns the opposite direction of the given edge.
ParserVector mySingleDataParsers
List of known parsers.
void parse_SignalGroupsToPhases()
Parses LSASIGNALGRUPPEZULSAPHASE.
NBNode * getNamedNode(const std::string &fieldName)
Tries to get the node which name is stored in the given field.
void parse_Kante()
Parses FLAECHENELEMENT.
void parse_SignalGroups()
Parses LSASIGNALGRUPPE/SIGNALGRUPPE.
NBNode * buildDistrictNode(const std::string &id, NBNode *dest, bool isSource)
Builds a node for the given district and returns it.
void parse_Lanes()
Parses FAHRSTREIFEN.
NBEdge * getEdge(NBNode *FromNode, NBNode *ToNode)
Returns the edge that connects both nodes.
NamedColumnsParser myLineParser
the parser to parse the information from the data lines
double getNamedFloat(const std::string &fieldName)
Returns the value from the named column as a float.
std::map< long long int, NBDistrict * > myShapeDistrictMap
A map from district shape definition name to the district.
void parse_Turns()
Parses ABBIEGEBEZIEHUNG/ABBIEGER.
void parse_Nodes()
Parses KNOTEN.
void parse_TurnsToSignalGroups()
Parses ABBZULSASIGNALGRUPPE/SIGNALGRUPPEZUABBIEGER.
NBEdge * getNamedEdgeContinuating(const std::string &fieldName, NBNode *node)
Tries to get the edge which name is stored in the given field continuating the search for a subedge t...
std::string getNamedString(const std::string &fieldName)
Returns the value from the named column as a normalised string.
void parse_LanesConnections()
Parses FAHRSTREIFENABBIEGER.
static bool isSplitEdge(NBEdge *edge, NBNode *node)
whether the edge id ends with _nodeID
void parse_Types()
Parses STRECKENTYP.
void parse_Connectors()
Parses ANBINDUNG.
void parse_AreaSubPartElement()
Parses ABBZULSASIGNALGRUPPE/SIGNALGRUPPEZUABBIEGER.
@ VISUM_PROJECTIONDEFINITION
@ VISUM_DISTRICT_CONNECTION
std::map< long long int, std::vector< long long int > > mySubPartsAreas
A map from area parts to area ids.
NIVisumTL_Map myTLS
List of visum traffic lights.
A signal group can be defined either by a time period or by phases.
std::map< std::string, Phase * > & phases()
Returns the phases map.
NBConnectionVector & connections()
Returns the connections vector.
Intermediate class for storing visum traffic lights during their import.
std::map< std::string, Phase * > & getPhases()
Returns the map of named phases.
SignalGroup & getSignalGroup(const std::string &name)
Returns the named signal group.
const std::string & getID() const
Returns the id.
A storage for options typed value containers).
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
double getFloat(const std::string &name) const
Returns the double-value of the named option (only for Option_Float).
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String).
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool).
static OptionsCont & getOptions()
Retrieves the options.
A point in 2D or 3D with translation and scaling methods.
Position positionAtOffset(double pos, double lateralOffset=0) const
Returns the position at the given length.
PositionVector reverse() const
reverse position vector
std::vector< std::string > getVector()
return vector of strings
static long long int toLong(const std::string &sData)
converts a string into the long value described by it by calling the char-type converter,...
static std::string to_lower_case(const std::string &str)
Transfers the content to lower case.
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter
static std::string latin1_to_utf8(std::string str)
Transfers from Latin 1 (ISO-8859-1) to UTF-8.
static bool endsWith(const std::string &str, const std::string suffix)
Checks whether a given string ends with the suffix.
static int toInt(const std::string &sData)
converts a string into the integer value described by it by calling the char-type converter,...
static bool toBool(const std::string &sData)
converts a string into the bool value described by it by calling the char-type converter
*brief user defined string literal for JSON values *sa std::size_t n
A complete call description for parsing a single db.
ParsingFunction function
Pointer to the function used for parsing.
std::string name
The name of the db.
long position
Position of the according db within the file.
Definition of a storage for vsystypes.