Eclipse SUMO - Simulation of Urban MObility
NIImporter_VISUM Class Reference

A VISUM network importer. More...

#include <NIImporter_VISUM.h>

Collaboration diagram for NIImporter_VISUM:
[legend]

Data Structures

struct  TypeParser
 A complete call description for parsing a single db. More...
 

Static Public Member Functions

static void loadNetwork (const OptionsCont &oc, NBNetBuilder &nb)
 Loads network definition from the assigned option and stores it in the given network builder. More...
 

Protected Types

enum  VISUM_KEY {
  VISUM_SYS , VISUM_LINKTYPE , VISUM_NODE , VISUM_DISTRICT ,
  VISUM_POINT , VISUM_LINK , VISUM_V0 , VISUM_TYPES ,
  VISUM_RANK , VISUM_CAPACITY , VISUM_XCOORD , VISUM_YCOORD ,
  VISUM_FROMNODE , VISUM_TONODE , VISUM_TYPE , VISUM_TYP ,
  VISUM_ID , VISUM_CODE , VISUM_DISTRICT_CONNECTION , VISUM_SOURCE_DISTRICT ,
  VISUM_FROMNODENO , VISUM_DIRECTION , VISUM_SURFACEID , VISUM_FACEID ,
  VISUM_FROMPOINTID , VISUM_TOPOINTID , VISUM_EDGE , VISUM_VIANODENO ,
  VISUM_NUMLANES , VISUM_TURN , VISUM_INDEX , VISUM_LINKPOLY ,
  VISUM_SURFACEITEM , VISUM_FACEITEM , VISUM_EDGEID , VISUM_ORIGIN ,
  VISUM_DESTINATION , VISUM_STOPPOINT , VISUM_NAME , VISUM_LINKNO ,
  VISUM_RELPOS , VISUM_CATID , VISUM_EDGEITEM , VISUM_POICATEGORY ,
  VISUM_NO
}
 

Protected Member Functions

void load ()
 Parses the VISUM-network file storing the parsed structures within myNetBuilder. More...
 
void loadLanguage (const std::string &file)
 
 NIImporter_VISUM (NBNetBuilder &nb, const std::string &file, NBCapacity2Lanes capacity2Lanes, bool useVisumPrio, const std::string &languageFile)
 constructor More...
 
 ~NIImporter_VISUM ()
 destructor More...
 

Static Protected Attributes

static StringBijection< VISUM_KEYKEYS
 link directions More...
 
static StringBijection< VISUM_KEY >::Entry KEYS_DE []
 Strings for the keywords. More...
 

Private Types

typedef std::map< std::string, NIVisumTL * > NIVisumTL_Map
 Definition of a map for loaded traffic lights (id->tls) More...
 
typedef std::vector< TypeParserParserVector
 Definition of the list of known parsers. More...
 
typedef void(NIImporter_VISUM::* ParsingFunction) ()
 Definition of a function for parsing a single line from a certain db. More...
 
typedef std::map< std::string, std::string > VSysTypeNames
 Definition of a storage for vsystypes. More...
 

Private Member Functions

void addParser (const std::string &name, ParsingFunction function)
 Adds a parser into the sorted list of parsers to use. More...
 
NBNodebuildDistrictNode (const std::string &id, NBNode *dest, bool isSource)
 Builds a node for the given district and returns it. More...
 
bool checkNodes (NBNode *from, NBNode *to)
 Returns whether both nodes are a valid combination of from/to-nodes. More...
 
NBEdgegetEdge (NBNode *FromNode, NBNode *ToNode)
 Returns the edge that connects both nodes. More...
 
NBEdgegetNamedEdge (const std::string &fieldName)
 Tries to get the edge which name is stored in the given field. More...
 
NBEdgegetNamedEdge (const std::string &fieldName1, const std::string &fieldName2)
 The same, but two different names for the field are allowed. More...
 
NBEdgegetNamedEdgeContinuating (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 that ends at the given node. More...
 
NBEdgegetNamedEdgeContinuating (const std::string &fieldName1, const std::string &fieldName2, NBNode *node)
 The same, but two different names for the field are allowed. More...
 
NBEdgegetNamedEdgeContinuating (NBEdge *begin, NBNode *node)
 The same, but for an already given edge. More...
 
double getNamedFloat (const std::string &fieldName)
 Returns the value from the named column as a float. More...
 
double getNamedFloat (const std::string &fieldName, double defaultValue)
 Returns the value from the named column as a float or the default value if an error occurs. More...
 
double getNamedFloat (const std::string &fieldName1, const std::string &fieldName2)
 The same, but two different names for the field are allowed. More...
 
double getNamedFloat (const std::string &fieldName1, const std::string &fieldName2, double defaultValue)
 The same, but two different names for the field are allowed. More...
 
NBNodegetNamedNode (const std::string &fieldName)
 Tries to get the node which name is stored in the given field. More...
 
NBNodegetNamedNode (const std::string &fieldName1, const std::string &fieldName2)
 The same, but two different names for the field are allowed. More...
 
NBNodegetNamedNodeSecure (const std::string &fieldName, NBNode *fallback=0)
 
std::string getNamedString (const std::string &fieldName)
 Returns the value from the named column as a normalised string. More...
 
std::string getNamedString (const std::string &fieldName1, const std::string &fieldName2)
 The same, but two different names for the field are allowed. More...
 
SVCPermissions getPermissions (const std::string &name, bool warn=false, SVCPermissions unknown=SVCAll)
 parse permissions More...
 
NBEdgegetReversedContinuating (NBEdge *edge, NBNode *node)
 Returns the opposite direction of the given edge. More...
 
bool getWeightedBool (const std::string &name)
 tries to get a bool which is possibly assigned to a certain modality More...
 
double getWeightedFloat (const std::string &name, const std::string &suffix)
 tries to get a double which is possibly assigned to a certain modality More...
 
double getWeightedFloat2 (const std::string &name, const std::string &name2, const std::string &suffix)
 as above but with two alternative names More...
 
void parse_AreaSubPartElement ()
 Parses ABBZULSASIGNALGRUPPE/SIGNALGRUPPEZUABBIEGER. More...
 
void parse_Connectors ()
 Parses ANBINDUNG. More...
 
void parse_Connectors_legacy ()
 
void parse_Districts ()
 Parses BEZIRK. More...
 
void parse_EdgePolys ()
 Parses STRECKENPOLY. More...
 
void parse_Edges ()
 Parses STRECKE/STRECKEN. More...
 
void parse_Kante ()
 Parses FLAECHENELEMENT. More...
 
void parse_Lanes ()
 Parses FAHRSTREIFEN. More...
 
void parse_LanesConnections ()
 Parses FAHRSTREIFENABBIEGER. More...
 
void parse_Nodes ()
 Parses KNOTEN. More...
 
void parse_NodesToTrafficLights ()
 Parses KNOTENZULSA/SIGNALANLAGEZUKNOTEN. More...
 
void parse_PartOfArea ()
 Parses FLAECHENELEMENT. More...
 
void parse_Phases ()
 Parses LSAPHASE/PHASE. More...
 
void parse_Point ()
 Parses PUNKT. More...
 
void parse_SignalGroups ()
 Parses LSASIGNALGRUPPE/SIGNALGRUPPE. More...
 
void parse_SignalGroupsToPhases ()
 Parses LSASIGNALGRUPPEZULSAPHASE. More...
 
void parse_stopPoints ()
 Parses HALTEPUNKT (public transport stop locations) More...
 
void parse_TrafficLights ()
 Parses LSA/SIGNALANLAGE. More...
 
void parse_Turns ()
 Parses ABBIEGEBEZIEHUNG/ABBIEGER. More...
 
void parse_TurnsToSignalGroups ()
 Parses ABBZULSASIGNALGRUPPE/SIGNALGRUPPEZUABBIEGER. More...
 
void parse_Types ()
 Parses STRECKENTYP. More...
 
void parse_VSysTypes ()
 Parses VSYS. More...
 

Static Private Member Functions

static bool isSplitEdge (NBEdge *edge, NBNode *node)
 whether the edge id ends with _nodeID More...
 

Private Attributes

NBCapacity2Lanes myCapacity2Lanes
 The converter to compute the lane number of edges from their capacity. More...
 
std::string myCurrentID
 The name of the currently parsed item used for error reporting. More...
 
std::map< NBDistrict *, PositionVectormyDistrictShapes
 A temporary storage for district shapes as they are filled incrementally. More...
 
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. More...
 
std::string myFileName
 The name of the parsed file, for error reporting. More...
 
NamedColumnsParser myLineParser
 the parser to parse the information from the data lines More...
 
LineReader myLineReader
 The line reader to use to read from the file. More...
 
NBNetBuildermyNetBuilder
 The network builder to fill with loaded values. More...
 
std::map< long long int, PositionmyPoints
 A map of point ids to positions. More...
 
std::map< long long int, NBDistrict * > myShapeDistrictMap
 A map from district shape definition name to the district. More...
 
ParserVector mySingleDataParsers
 List of known parsers. More...
 
std::map< long long int, std::vector< long long int > > mySubPartsAreas
 A map from area parts to area ids. More...
 
NIVisumTL_Map myTLS
 List of visum traffic lights. More...
 
std::vector< std::string > myTouchedEdges
 Already read edges. More...
 
bool myUseVisumPrio
 Information whether VISUM priority information shall be used. More...
 
VSysTypeNames myVSysTypes
 The used vsystypes. More...
 

Detailed Description

A VISUM network importer.

This class build an internal list of those VISUM-db entries which are supported, first. This list is sorted in a way that the parsed dbs can build upon each other as their related structures within the XML-input. So, nodes are loaded first, then edges, etc.

Because these structures may have a different order within the VISUM-file than we need, at first the file is scanned and any occurrence of one of the searched dbs is saved. That's where the "Found $XXX at YYY" are printed. "YYY" is the character position within the file.

In a second step, the dbs are parsed in the order we need. It is asked for each subsequently whether it was found and if so, the proper parse_XXX() method is called.

Definition at line 66 of file NIImporter_VISUM.h.

Member Typedef Documentation

◆ NIVisumTL_Map

typedef std::map<std::string, NIVisumTL*> NIImporter_VISUM::NIVisumTL_Map
private

Definition of a map for loaded traffic lights (id->tls)

Definition at line 495 of file NIImporter_VISUM.h.

◆ ParserVector

typedef std::vector<TypeParser> NIImporter_VISUM::ParserVector
private

Definition of the list of known parsers.

Definition at line 490 of file NIImporter_VISUM.h.

◆ ParsingFunction

typedef void(NIImporter_VISUM::* NIImporter_VISUM::ParsingFunction) ()
private

Definition of a function for parsing a single line from a certain db.

This function may assume that both the LineParser is initialised with the current line.

Definition at line 355 of file NIImporter_VISUM.h.

◆ VSysTypeNames

typedef std::map<std::string, std::string> NIImporter_VISUM::VSysTypeNames
private

Definition of a storage for vsystypes.

Definition at line 485 of file NIImporter_VISUM.h.

Member Enumeration Documentation

◆ VISUM_KEY

Enumerator
VISUM_SYS 
VISUM_LINKTYPE 
VISUM_NODE 
VISUM_DISTRICT 
VISUM_POINT 
VISUM_LINK 
VISUM_V0 
VISUM_TYPES 
VISUM_RANK 
VISUM_CAPACITY 
VISUM_XCOORD 
VISUM_YCOORD 
VISUM_FROMNODE 
VISUM_TONODE 
VISUM_TYPE 
VISUM_TYP 
VISUM_ID 
VISUM_CODE 
VISUM_DISTRICT_CONNECTION 
VISUM_SOURCE_DISTRICT 
VISUM_FROMNODENO 
VISUM_DIRECTION 
VISUM_SURFACEID 
VISUM_FACEID 
VISUM_FROMPOINTID 
VISUM_TOPOINTID 
VISUM_EDGE 
VISUM_VIANODENO 
VISUM_NUMLANES 
VISUM_TURN 
VISUM_INDEX 
VISUM_LINKPOLY 
VISUM_SURFACEITEM 
VISUM_FACEITEM 
VISUM_EDGEID 
VISUM_ORIGIN 
VISUM_DESTINATION 
VISUM_STOPPOINT 
VISUM_NAME 
VISUM_LINKNO 
VISUM_RELPOS 
VISUM_CATID 
VISUM_EDGEITEM 
VISUM_POICATEGORY 
VISUM_NO 

Definition at line 529 of file NIImporter_VISUM.h.

Constructor & Destructor Documentation

◆ NIImporter_VISUM()

NIImporter_VISUM::NIImporter_VISUM ( NBNetBuilder nb,
const std::string &  file,
NBCapacity2Lanes  capacity2Lanes,
bool  useVisumPrio,
const std::string &  languageFile 
)
protected

constructor

Builds the list of typed db parsers ("TypeParser") and stores them in mySingleDataParsers in the order the according db values must be parsed.

Parameters
[in,out]nbthe network builder (storage) to fill with parsed values
[in]fileThe name of the file to parse
[in]capacity2LanesThe converter from flow to lanes
[in]useVisumPrioInformation whether the VISUM type's priority shall be used

Definition at line 116 of file NIImporter_VISUM.cpp.

References addParser(), OptionsCont::getOptions(), StringBijection< T >::getString(), KEYS, loadLanguage(), parse_AreaSubPartElement(), parse_Connectors(), parse_Connectors_legacy(), parse_Districts(), parse_EdgePolys(), parse_Edges(), parse_Kante(), parse_Lanes(), parse_LanesConnections(), parse_Nodes(), parse_NodesToTrafficLights(), parse_PartOfArea(), parse_Phases(), parse_Point(), parse_SignalGroups(), parse_SignalGroupsToPhases(), parse_stopPoints(), parse_TrafficLights(), parse_Turns(), parse_TurnsToSignalGroups(), parse_Types(), parse_VSysTypes(), VISUM_DISTRICT, VISUM_DISTRICT_CONNECTION, VISUM_EDGE, VISUM_FACEITEM, VISUM_LINK, VISUM_LINKPOLY, VISUM_LINKTYPE, VISUM_NODE, VISUM_POINT, VISUM_STOPPOINT, VISUM_SURFACEITEM, VISUM_SYS, and VISUM_TURN.

◆ ~NIImporter_VISUM()

NIImporter_VISUM::~NIImporter_VISUM ( )
protected

destructor

Definition at line 184 of file NIImporter_VISUM.cpp.

References myTLS.

Member Function Documentation

◆ addParser()

void NIImporter_VISUM::addParser ( const std::string &  name,
ParsingFunction  function 
)
private

Adds a parser into the sorted list of parsers to use.

Parameters
[in]namedb name to assign the parser to
[in]functionThe function to use for parsing the named db

Definition at line 192 of file NIImporter_VISUM.cpp.

References NIImporter_VISUM::TypeParser::function, mySingleDataParsers, NIImporter_VISUM::TypeParser::name, and NIImporter_VISUM::TypeParser::position.

Referenced by NIImporter_VISUM().

Here is the caller graph for this function:

◆ buildDistrictNode()

NBNode * NIImporter_VISUM::buildDistrictNode ( const std::string &  id,
NBNode dest,
bool  isSource 
)
private

Builds a node for the given district and returns it.

If the district does not exist, an error is generated and 0 returned. Otherwise a position for the new node is computed and the new node is built using a combination of the district name and the node name as id. If Inserting this node into the net builder fails, zero is returned.

Parameters
[in]idName of the district
[in]destName of the according network node
[in]isSourceInformation whether this node will be used as a source
Returns
The built node, zero if an error occurred

Definition at line 1496 of file NIImporter_VISUM.cpp.

References NBNetBuilder::getDistrictCont(), Named::getID(), NBNetBuilder::getNodeCont(), NBDistrict::getPosition(), NBNodeCont::insert(), myNetBuilder, NBDistrictCont::retrieve(), NBNodeCont::retrieve(), TL, and WRITE_ERRORF.

Referenced by parse_Connectors_legacy().

Here is the caller graph for this function:

◆ checkNodes()

bool NIImporter_VISUM::checkNodes ( NBNode from,
NBNode to 
)
private

Returns whether both nodes are a valid combination of from/to-nodes.

They are valid if both are !=0 and differ.

Parameters
[in]fromThe from-node
[in]fromThe to-node
Returns
Whether the nodes may be used

Definition at line 1519 of file NIImporter_VISUM.cpp.

References TL, and WRITE_ERROR.

Referenced by parse_EdgePolys(), and parse_Edges().

Here is the caller graph for this function:

◆ getEdge()

NBEdge * NIImporter_VISUM::getEdge ( NBNode FromNode,
NBNode ToNode 
)
private

Returns the edge that connects both nodes.

Parameters
[in]FromNodeName of the node the edge shall start at
[in]ToNodeName of the node the edge shall end at
Returns
The edge connecting both nodes, 0 if no such edge exists

!!

Definition at line 1421 of file NIImporter_VISUM.cpp.

References NBNode::getOutgoingEdges().

Referenced by parse_TurnsToSignalGroups().

Here is the caller graph for this function:

◆ getNamedEdge() [1/2]

NBEdge * NIImporter_VISUM::getNamedEdge ( const std::string &  fieldName)
private

Tries to get the edge which name is stored in the given field.

If the field can not be parsed, an exception is thrown. Prints an error if the edge could not be found, returning 0. Otherwise, if the field could be parsed and the edge was found, this edge is returned.

Parameters
[in]fieldNameName of the column to extract the edge's name from
Returns
An already known edge with the found name
Exceptions
OutOfBoundsExceptionIf the current data line has less entries than the edge id's position
NumberFormatExceptionIf the edge id is not numeric
UnknownElementIf the named data field is not in the line

Definition at line 1301 of file NIImporter_VISUM.cpp.

References NamedColumnsParser::get(), NBNetBuilder::getEdgeCont(), myLineParser, myNetBuilder, NBHelpers::normalIDRepresentation(), NBEdgeCont::retrieve(), TL, and WRITE_ERRORF.

Referenced by getNamedEdge(), parse_Lanes(), parse_LanesConnections(), and parse_stopPoints().

Here is the caller graph for this function:

◆ getNamedEdge() [2/2]

NBEdge * NIImporter_VISUM::getNamedEdge ( const std::string &  fieldName1,
const std::string &  fieldName2 
)
private

The same, but two different names for the field are allowed.

Parameters
[in]fieldName1Name of the first column to extract the edge's name from
[in]fieldName2Name of the second column to extract the edge's name from
Returns
An already known edge with the found name
Exceptions
OutOfBoundsExceptionIf the current data line has less entries than the edge id's position
NumberFormatExceptionIf the edge id is not numeric
UnknownElementIf the named data field is not in the line

Definition at line 1312 of file NIImporter_VISUM.cpp.

References getNamedEdge(), NamedColumnsParser::know(), and myLineParser.

◆ getNamedEdgeContinuating() [1/3]

NBEdge * NIImporter_VISUM::getNamedEdgeContinuating ( const std::string &  fieldName,
NBNode node 
)
private

Tries to get the edge which name is stored in the given field continuating the search for a subedge that ends at the given node.

If the field can not be parsed, an exception is thrown. Prints an error if the edge could not be found, returning 0. Otherwise, if the field could be parsed and the edge was found, this edge is returned.

Parameters
[in]fieldNameName of the column to extract the edge's name from
[in]nodeThe node the consecutive edge must end at in order to be returned
Returns
The edge's continuation up to the given node, 0 if not found
Exceptions
OutOfBoundsExceptionIf the current data line has less entries than the edge id's position
NumberFormatExceptionIf the edge id is not numeric
UnknownElementIf the named data field is not in the line

Definition at line 1399 of file NIImporter_VISUM.cpp.

References NamedColumnsParser::get(), NBNetBuilder::getEdgeCont(), myLineParser, myNetBuilder, NBHelpers::normalIDRepresentation(), NBEdgeCont::retrieve(), TL, and WRITE_ERRORF.

Referenced by getNamedEdgeContinuating(), getReversedContinuating(), parse_Lanes(), parse_LanesConnections(), and parse_TurnsToSignalGroups().

Here is the caller graph for this function:

◆ getNamedEdgeContinuating() [2/3]

NBEdge * NIImporter_VISUM::getNamedEdgeContinuating ( const std::string &  fieldName1,
const std::string &  fieldName2,
NBNode node 
)
private

The same, but two different names for the field are allowed.

Parameters
[in]fieldName1Name of the first column to extract the edge's name from
[in]fieldName2Name of the second column to extract the edge's name from
[in]nodeThe node the consecutive edge must end at in order to be returned
Returns
The edge's continuation up to the given node, 0 if not found
Exceptions
OutOfBoundsExceptionIf the current data line has less entries than the edge id's position
NumberFormatExceptionIf the edge id is not numeric
UnknownElementIf the named data field is not in the line

Definition at line 1410 of file NIImporter_VISUM.cpp.

References getNamedEdgeContinuating(), NamedColumnsParser::know(), and myLineParser.

◆ getNamedEdgeContinuating() [3/3]

NBEdge * NIImporter_VISUM::getNamedEdgeContinuating ( NBEdge begin,
NBNode node 
)
private

The same, but for an already given edge.

Parameters
[in]beginThe edge to get the continuation of
[in]nodeThe node the consecutive edge must end at in order to be returned
Returns
The edge's continuation up to the given node, 0 if not found

Definition at line 1338 of file NIImporter_VISUM.cpp.

References NBEdge::getFromNode(), NBEdge::getID(), Named::getID(), NBNode::getIncomingEdges(), NBNode::getOutgoingEdges(), and NBEdge::getToNode().

◆ getNamedFloat() [1/4]

double NIImporter_VISUM::getNamedFloat ( const std::string &  fieldName)
private

Returns the value from the named column as a float.

Parameters
[in]fieldNameName of the column to extract the float from
Returns
The parsed real
Exceptions
OutOfBoundsExceptionIf the current data line has less entries than the float's position
NumberFormatExceptionIf the float is not numeric
UnknownElementIf the named data field is not in the line

Definition at line 1434 of file NIImporter_VISUM.cpp.

References StringUtils::endsWith(), NamedColumnsParser::get(), myLineParser, and StringUtils::toDouble().

Referenced by getNamedFloat(), parse_Connectors(), parse_Connectors_legacy(), parse_Districts(), parse_EdgePolys(), parse_Nodes(), parse_Phases(), parse_SignalGroups(), and parse_Types().

Here is the caller graph for this function:

◆ getNamedFloat() [2/4]

double NIImporter_VISUM::getNamedFloat ( const std::string &  fieldName,
double  defaultValue 
)
private

Returns the value from the named column as a float or the default value if an error occurs.

Parameters
[in]fieldNameName of the column to extract the float from
[in]defaultValueThe default to return in the case of an error
Returns
The parsed real or the default value if an error while parsing occurred

Definition at line 1444 of file NIImporter_VISUM.cpp.

References NamedColumnsParser::get(), myLineParser, and StringUtils::toDouble().

◆ getNamedFloat() [3/4]

double NIImporter_VISUM::getNamedFloat ( const std::string &  fieldName1,
const std::string &  fieldName2 
)
private

The same, but two different names for the field are allowed.

Parameters
[in]fieldName1Name of the first column to extract the float from
[in]fieldName2Name of the second column to extract the efloat from
Returns
The parsed real
Exceptions
OutOfBoundsExceptionIf the current data line has less entries than the float's position
NumberFormatExceptionIf the float is not numeric
UnknownElementIf the named data field is not in the line

Definition at line 1454 of file NIImporter_VISUM.cpp.

References getNamedFloat(), NamedColumnsParser::know(), and myLineParser.

◆ getNamedFloat() [4/4]

double NIImporter_VISUM::getNamedFloat ( const std::string &  fieldName1,
const std::string &  fieldName2,
double  defaultValue 
)
private

The same, but two different names for the field are allowed.

Parameters
[in]fieldName1Name of the first column to extract the float from
[in]fieldName2Name of the second column to extract the efloat from
[in]defaultValueThe default to return in the case of an error
Returns
The parsed real or the default value if an error while parsing occurred

Definition at line 1464 of file NIImporter_VISUM.cpp.

References getNamedFloat(), NamedColumnsParser::know(), and myLineParser.

◆ getNamedNode() [1/2]

NBNode * NIImporter_VISUM::getNamedNode ( const std::string &  fieldName)
private

Tries to get the node which name is stored in the given field.

If the field can not be parsed, an exception is thrown. Prints an error if the node could not be found, returning 0. Otherwise, if the field could be parsed and the node was found, this node is returned.

Parameters
[in]fieldNameName of the column to extract the node's name from
Returns
An already known node with the found name
Exceptions
OutOfBoundsExceptionIf the current data line has less entries than the node id's position
NumberFormatExceptionIf the node id is not numeric
UnknownElementIf the named data field is not in the line

Definition at line 1270 of file NIImporter_VISUM.cpp.

References NamedColumnsParser::get(), NBNetBuilder::getNodeCont(), myLineParser, myNetBuilder, NBHelpers::normalIDRepresentation(), NBNodeCont::retrieve(), TL, and WRITE_ERRORF.

Referenced by getNamedNode(), parse_Connectors(), parse_Connectors_legacy(), parse_EdgePolys(), parse_Edges(), parse_LanesConnections(), parse_Turns(), and parse_TurnsToSignalGroups().

Here is the caller graph for this function:

◆ getNamedNode() [2/2]

NBNode * NIImporter_VISUM::getNamedNode ( const std::string &  fieldName1,
const std::string &  fieldName2 
)
private

The same, but two different names for the field are allowed.

Parameters
[in]fieldName1Name of the first column to extract the node's name from
[in]fieldName2Name of the second column to extract the node's name from
Returns
An already known node with the found name
Exceptions
OutOfBoundsExceptionIf the current data line has less entries than the node id's position
NumberFormatExceptionIf the node id is not numeric
UnknownElementIf the named data field is not in the line

Definition at line 1291 of file NIImporter_VISUM.cpp.

References getNamedNode(), NamedColumnsParser::know(), and myLineParser.

◆ getNamedNodeSecure()

NBNode * NIImporter_VISUM::getNamedNodeSecure ( const std::string &  fieldName,
NBNode fallback = 0 
)
private

Definition at line 1280 of file NIImporter_VISUM.cpp.

References NamedColumnsParser::get(), NBNetBuilder::getNodeCont(), myLineParser, myNetBuilder, NBHelpers::normalIDRepresentation(), and NBNodeCont::retrieve().

Referenced by parse_Lanes(), and parse_stopPoints().

Here is the caller graph for this function:

◆ getNamedString() [1/2]

std::string NIImporter_VISUM::getNamedString ( const std::string &  fieldName)
private

Returns the value from the named column as a normalised string.

"Normalised" means herein that the leading '0' (zeros) are prunned.

Parameters
[in]fieldNameName of the column to extract the string from
Returns
The parsed, normalised string
Exceptions
OutOfBoundsExceptionIf the current data line has less entries than the string's position
NumberFormatExceptionIf the string is not numeric
UnknownElementIf the named data field is not in the line

Definition at line 1475 of file NIImporter_VISUM.cpp.

References NamedColumnsParser::get(), myLineParser, and NBHelpers::normalIDRepresentation().

Referenced by getNamedString(), parse_LanesConnections(), and parse_TurnsToSignalGroups().

Here is the caller graph for this function:

◆ getNamedString() [2/2]

std::string NIImporter_VISUM::getNamedString ( const std::string &  fieldName1,
const std::string &  fieldName2 
)
private

The same, but two different names for the field are allowed.

Parameters
[in]fieldName1Name of the first column to extract the string from
[in]fieldName2Name of the second column to extract the string from
Returns
The parsed, normalised string
Exceptions
OutOfBoundsExceptionIf the current data line has less entries than the string's position
NumberFormatExceptionIf the string is not numeric
UnknownElementIf the named data field is not in the line

Definition at line 1481 of file NIImporter_VISUM.cpp.

References getNamedString(), NamedColumnsParser::know(), and myLineParser.

◆ getPermissions()

SVCPermissions NIImporter_VISUM::getPermissions ( const std::string &  name,
bool  warn = false,
SVCPermissions  unknown = SVCAll 
)
private

parse permissions

Definition at line 1239 of file NIImporter_VISUM.cpp.

References NamedColumnsParser::get(), StringBijection< T >::getString(), StringTokenizer::getVector(), KEYS, myLineParser, SVC_BICYCLE, SVC_BUS, SVC_PASSENGER, SVC_PEDESTRIAN, SVC_RAIL, SVC_TRAM, SVC_TRUCK, StringUtils::to_lower_case(), VISUM_NO, and WRITE_WARNINGF.

Referenced by parse_Edges(), parse_stopPoints(), and parse_Types().

Here is the caller graph for this function:

◆ getReversedContinuating()

NBEdge * NIImporter_VISUM::getReversedContinuating ( NBEdge edge,
NBNode node 
)
private

Returns the opposite direction of the given edge.

Because the opposite direction edge may be split, not the the plain opposite edge, the one which name is obtained by adding/removing the leading '-', is returned, but its continuation until the named node.

Parameters
[in]edgeName of the edge to find the opposite of
[in]nodeName of the node the opposite edge's continuation must end at
Returns
The found opposite edge's continuation, 0 if not found

Definition at line 1323 of file NIImporter_VISUM.cpp.

References NBNetBuilder::getEdgeCont(), NBEdge::getID(), getNamedEdgeContinuating(), myNetBuilder, and NBEdgeCont::retrieve().

Referenced by parse_Lanes(), and parse_LanesConnections().

Here is the caller graph for this function:

◆ getWeightedBool()

bool NIImporter_VISUM::getWeightedBool ( const std::string &  name)
private

tries to get a bool which is possibly assigned to a certain modality

When the bool cannot be extracted using the given name, "IV" is appended to the begin of the name. Note that this function does not yet support public traffic.

Parameters
[in]nameName of the column to extract the bool from
Returns
The bool stored under the named column, or if not found the one from "(IV)"+name, or if not found false

Definition at line 1228 of file NIImporter_VISUM.cpp.

References NamedColumnsParser::get(), myLineParser, and StringUtils::toBool().

◆ getWeightedFloat()

double NIImporter_VISUM::getWeightedFloat ( const std::string &  name,
const std::string &  suffix 
)
private

tries to get a double which is possibly assigned to a certain modality

When the double cannot be extracted using the given name, "(IV)" is appended to the begin of the name. Note that this function does not yet support public traffic.

Parameters
[in]nameName of the column to extract the real from
Returns
The real stored under the named column, or if not found the one from name + suffix, or if not found -1

Definition at line 1205 of file NIImporter_VISUM.cpp.

References NamedColumnsParser::get(), myLineParser, and StringUtils::toDouble().

Referenced by getWeightedFloat2(), and parse_TrafficLights().

Here is the caller graph for this function:

◆ getWeightedFloat2()

double NIImporter_VISUM::getWeightedFloat2 ( const std::string &  name,
const std::string &  name2,
const std::string &  suffix 
)
private

as above but with two alternative names

Definition at line 1218 of file NIImporter_VISUM.cpp.

References getWeightedFloat().

Referenced by parse_TrafficLights(), and parse_Types().

Here is the caller graph for this function:

◆ isSplitEdge()

bool NIImporter_VISUM::isSplitEdge ( NBEdge edge,
NBNode node 
)
staticprivate

whether the edge id ends with _nodeID

Definition at line 1533 of file NIImporter_VISUM.cpp.

References NBEdge::getID(), and Named::getID().

Referenced by parse_Lanes().

Here is the caller graph for this function:

◆ load()

void NIImporter_VISUM::load ( )
protected

Parses the VISUM-network file storing the parsed structures within myNetBuilder.

At first, it is checked whether the file can be opened. A ProcessError is thrown if not. Otherwise, the file is scanned for occurrences of db table begins. For each found db, its position within the file, and the column names are stored in the according TypeParser. After this, the sorted list of type parsers is one through and each found is used to parse the entries at the found positions using the found column names.

Exceptions
ProcessErrorIf the file could not be opened

Definition at line 202 of file NIImporter_VISUM.cpp.

References NBNetBuilder::getEdgeCont(), LineReader::getLineNumber(), LineReader::getPosition(), NBNetBuilder::getTLLogicCont(), LineReader::hasMore(), myCurrentID, myDistrictShapes, myFileName, myLineParser, myLineReader, myNetBuilder, mySingleDataParsers, myTLS, NamedColumnsParser::parseLine(), PROGRESS_BEGIN_MESSAGE, PROGRESS_DONE_MESSAGE, LineReader::readLine(), NBEdgeCont::reduceGeometries(), LineReader::reinit(), NamedColumnsParser::reinit(), LineReader::setFile(), LineReader::setPos(), TL, TLF, WRITE_ERRORF, and WRITE_MESSAGE.

Referenced by loadNetwork().

Here is the caller graph for this function:

◆ loadLanguage()

void NIImporter_VISUM::loadLanguage ( const std::string &  file)
protected

Definition at line 1539 of file NIImporter_VISUM.cpp.

References StringBijection< T >::get(), StringBijection< T >::hasString(), StringBijection< T >::insert(), KEYS, StringBijection< T >::remove(), TL, TLF, and WRITE_WARNINGF.

Referenced by NIImporter_VISUM().

Here is the caller graph for this function:

◆ loadNetwork()

void NIImporter_VISUM::loadNetwork ( const OptionsCont oc,
NBNetBuilder nb 
)
static

Loads network definition from the assigned option and stores it in the given network builder.

If the option "visum" is set, the file stored therein is read and the network definition stored therein is stored within the given network builder.

If the option "visum" is not set, this method simply returns.

Parameters
[in]ocThe options to use
[in]nbThe network builder to fill

Definition at line 98 of file NIImporter_VISUM.cpp.

References OptionsCont::getBool(), OptionsCont::getFloat(), OptionsCont::getString(), OptionsCont::isSet(), and load().

Referenced by NILoader::load().

Here is the caller graph for this function:

◆ parse_AreaSubPartElement()

void NIImporter_VISUM::parse_AreaSubPartElement ( )
private

Parses ABBZULSASIGNALGRUPPE/SIGNALGRUPPEZUABBIEGER.

Definition at line 983 of file NIImporter_VISUM.cpp.

References NamedColumnsParser::get(), StringBijection< T >::getString(), KEYS, myCurrentID, myDistrictShapes, myEdges, myLineParser, myPoints, myShapeDistrictMap, mySubPartsAreas, PositionVector::reverse(), TL, StringUtils::toLong(), VISUM_DIRECTION, VISUM_EDGEID, VISUM_FACEID, WRITE_ERROR, and WRITE_ERRORF.

Referenced by NIImporter_VISUM().

Here is the caller graph for this function:

◆ parse_Connectors()

void NIImporter_VISUM::parse_Connectors ( )
private

◆ parse_Connectors_legacy()

◆ parse_Districts()

void NIImporter_VISUM::parse_Districts ( )
private

◆ parse_EdgePolys()

void NIImporter_VISUM::parse_EdgePolys ( )
private

Parses STRECKENPOLY.

Definition at line 683 of file NIImporter_VISUM.cpp.

References NBEdge::addGeometryPoint(), checkNodes(), NamedColumnsParser::get(), NBNode::getConnectionTo(), Named::getID(), getNamedFloat(), getNamedNode(), OptionsCont::getOptions(), StringBijection< T >::getString(), KEYS, myLineParser, TL, StringUtils::toInt(), NBNetBuilder::transformCoordinate(), VISUM_FROMNODE, VISUM_INDEX, VISUM_TONODE, VISUM_XCOORD, VISUM_YCOORD, WRITE_ERRORF, and WRITE_WARNINGF.

Referenced by NIImporter_VISUM().

Here is the caller graph for this function:

◆ parse_Edges()

◆ parse_Kante()

void NIImporter_VISUM::parse_Kante ( )
private

Parses FLAECHENELEMENT.

Definition at line 483 of file NIImporter_VISUM.cpp.

References NamedColumnsParser::get(), StringBijection< T >::getString(), KEYS, myEdges, myLineParser, StringUtils::toLong(), VISUM_FROMPOINTID, VISUM_ID, and VISUM_TOPOINTID.

Referenced by NIImporter_VISUM().

Here is the caller graph for this function:

◆ parse_Lanes()

◆ parse_LanesConnections()

void NIImporter_VISUM::parse_LanesConnections ( )
private

◆ parse_Nodes()

void NIImporter_VISUM::parse_Nodes ( )
private

Parses KNOTEN.

Definition at line 313 of file NIImporter_VISUM.cpp.

References NamedColumnsParser::get(), getNamedFloat(), NBNetBuilder::getNodeCont(), StringBijection< T >::getString(), NBNodeCont::insert(), KEYS, myCurrentID, myLineParser, myNetBuilder, NBHelpers::normalIDRepresentation(), TL, NBNetBuilder::transformCoordinate(), VISUM_NO, VISUM_XCOORD, VISUM_YCOORD, and WRITE_ERRORF.

Referenced by NIImporter_VISUM().

Here is the caller graph for this function:

◆ parse_NodesToTrafficLights()

void NIImporter_VISUM::parse_NodesToTrafficLights ( )
private

Parses KNOTENZULSA/SIGNALANLAGEZUKNOTEN.

Definition at line 889 of file NIImporter_VISUM.cpp.

References NamedColumnsParser::get(), NBNetBuilder::getNodeCont(), myLineParser, myNetBuilder, myTLS, NBNodeCont::retrieve(), and WRITE_ERROR.

Referenced by NIImporter_VISUM().

Here is the caller graph for this function:

◆ parse_PartOfArea()

void NIImporter_VISUM::parse_PartOfArea ( )
private

Parses FLAECHENELEMENT.

Definition at line 492 of file NIImporter_VISUM.cpp.

References NamedColumnsParser::get(), StringBijection< T >::getString(), KEYS, myLineParser, mySubPartsAreas, StringUtils::toLong(), VISUM_FACEID, and VISUM_SURFACEID.

Referenced by NIImporter_VISUM().

Here is the caller graph for this function:

◆ parse_Phases()

void NIImporter_VISUM::parse_Phases ( )
private

Parses LSAPHASE/PHASE.

Definition at line 1032 of file NIImporter_VISUM.cpp.

References NamedColumnsParser::get(), getNamedFloat(), StringBijection< T >::getString(), KEYS, NamedColumnsParser::know(), myLineParser, myTLS, NBHelpers::normalIDRepresentation(), TIME2STEPS, and VISUM_NO.

Referenced by NIImporter_VISUM().

Here is the caller graph for this function:

◆ parse_Point()

void NIImporter_VISUM::parse_Point ( )
private

Parses PUNKT.

Definition at line 362 of file NIImporter_VISUM.cpp.

References NamedColumnsParser::get(), StringBijection< T >::getString(), KEYS, myLineParser, myPoints, TL, StringUtils::toDouble(), StringUtils::toLong(), toString(), NBNetBuilder::transformCoordinate(), VISUM_ID, VISUM_XCOORD, VISUM_YCOORD, and WRITE_ERRORF.

Referenced by NIImporter_VISUM().

Here is the caller graph for this function:

◆ parse_SignalGroups()

void NIImporter_VISUM::parse_SignalGroups ( )
private

Parses LSASIGNALGRUPPE/SIGNALGRUPPE.

Definition at line 909 of file NIImporter_VISUM.cpp.

References NamedColumnsParser::get(), getNamedFloat(), StringBijection< T >::getString(), KEYS, NamedColumnsParser::know(), myCurrentID, myLineParser, myTLS, NBHelpers::normalIDRepresentation(), TIME2STEPS, TL, VISUM_NO, and WRITE_ERRORF.

Referenced by NIImporter_VISUM().

Here is the caller graph for this function:

◆ parse_SignalGroupsToPhases()

void NIImporter_VISUM::parse_SignalGroupsToPhases ( )
private

Parses LSASIGNALGRUPPEZULSAPHASE.

Definition at line 1043 of file NIImporter_VISUM.cpp.

References NamedColumnsParser::get(), NIVisumTL::getPhases(), NIVisumTL::getSignalGroup(), myLineParser, myTLS, NBHelpers::normalIDRepresentation(), and NIVisumTL::SignalGroup::phases().

Referenced by NIImporter_VISUM().

Here is the caller graph for this function:

◆ parse_stopPoints()

◆ parse_TrafficLights()

void NIImporter_VISUM::parse_TrafficLights ( )
private

Parses LSA/SIGNALANLAGE.

Definition at line 875 of file NIImporter_VISUM.cpp.

References NamedColumnsParser::get(), StringBijection< T >::getString(), getWeightedFloat(), getWeightedFloat2(), KEYS, NamedColumnsParser::know(), myCurrentID, myLineParser, myTLS, NBHelpers::normalIDRepresentation(), TIME2STEPS, StringUtils::toBool(), and VISUM_NO.

Referenced by NIImporter_VISUM().

Here is the caller graph for this function:

◆ parse_Turns()

void NIImporter_VISUM::parse_Turns ( )
private

Parses ABBIEGEBEZIEHUNG/ABBIEGER.

Definition at line 642 of file NIImporter_VISUM.cpp.

References NBEdge::addEdge2EdgeConnection(), NamedColumnsParser::get(), NBNode::getConnectionTo(), Named::getID(), getNamedNode(), OptionsCont::getOptions(), StringBijection< T >::getString(), KEYS, NamedColumnsParser::know(), myLineParser, myVSysTypes, TL, VISUM_FROMNODE, VISUM_TONODE, VISUM_TYPES, VISUM_VIANODENO, and WRITE_WARNINGF.

Referenced by NIImporter_VISUM().

Here is the caller graph for this function:

◆ parse_TurnsToSignalGroups()

void NIImporter_VISUM::parse_TurnsToSignalGroups ( )
private

Parses ABBZULSASIGNALGRUPPE/SIGNALGRUPPEZUABBIEGER.

XXX could be retrieved from context

Definition at line 925 of file NIImporter_VISUM.cpp.

References NIVisumTL::SignalGroup::connections(), getEdge(), NBNetBuilder::getEdgeCont(), NBEdge::getID(), getNamedEdgeContinuating(), getNamedNode(), getNamedString(), NBNode::hasIncoming(), NBNode::hasOutgoing(), NamedColumnsParser::know(), myLineParser, myNetBuilder, myTLS, NBEdgeCont::retrieve(), TL, and WRITE_WARNING.

Referenced by NIImporter_VISUM().

Here is the caller graph for this function:

◆ parse_Types()

◆ parse_VSysTypes()

void NIImporter_VISUM::parse_VSysTypes ( )
private

Parses VSYS.

Definition at line 275 of file NIImporter_VISUM.cpp.

References NamedColumnsParser::get(), StringBijection< T >::getString(), KEYS, NamedColumnsParser::know(), myLineParser, myVSysTypes, VISUM_CODE, and VISUM_TYP.

Referenced by NIImporter_VISUM().

Here is the caller graph for this function:

Field Documentation

◆ KEYS

◆ KEYS_DE

StringBijection< NIImporter_VISUM::VISUM_KEY >::Entry NIImporter_VISUM::KEYS_DE
staticprotected

Strings for the keywords.

Definition at line 579 of file NIImporter_VISUM.h.

◆ myCapacity2Lanes

NBCapacity2Lanes NIImporter_VISUM::myCapacity2Lanes
private

The converter to compute the lane number of edges from their capacity.

Definition at line 482 of file NIImporter_VISUM.h.

Referenced by parse_Edges(), and parse_Types().

◆ myCurrentID

std::string NIImporter_VISUM::myCurrentID
private

The name of the currently parsed item used for error reporting.

Definition at line 506 of file NIImporter_VISUM.h.

Referenced by load(), parse_AreaSubPartElement(), parse_Districts(), parse_Edges(), parse_Nodes(), parse_SignalGroups(), parse_TrafficLights(), and parse_Types().

◆ myDistrictShapes

std::map<NBDistrict*, PositionVector> NIImporter_VISUM::myDistrictShapes
private

A temporary storage for district shapes as they are filled incrementally.

Definition at line 522 of file NIImporter_VISUM.h.

Referenced by load(), and parse_AreaSubPartElement().

◆ myEdges

std::map<long long int, std::pair<long long int, long long int> > NIImporter_VISUM::myEdges
private

A map of edge (not road, but "edge" in this case) ids to from/to-points.

Definition at line 513 of file NIImporter_VISUM.h.

Referenced by parse_AreaSubPartElement(), and parse_Kante().

◆ myFileName

std::string NIImporter_VISUM::myFileName
private

The name of the parsed file, for error reporting.

Definition at line 471 of file NIImporter_VISUM.h.

Referenced by load().

◆ myLineParser

◆ myLineReader

LineReader NIImporter_VISUM::myLineReader
private

The line reader to use to read from the file.

Definition at line 474 of file NIImporter_VISUM.h.

Referenced by load().

◆ myNetBuilder

◆ myPoints

std::map<long long int, Position> NIImporter_VISUM::myPoints
private

A map of point ids to positions.

Definition at line 510 of file NIImporter_VISUM.h.

Referenced by parse_AreaSubPartElement(), and parse_Point().

◆ myShapeDistrictMap

std::map<long long int, NBDistrict*> NIImporter_VISUM::myShapeDistrictMap
private

A map from district shape definition name to the district.

Definition at line 516 of file NIImporter_VISUM.h.

Referenced by parse_AreaSubPartElement(), and parse_Districts().

◆ mySingleDataParsers

ParserVector NIImporter_VISUM::mySingleDataParsers
private

List of known parsers.

Definition at line 492 of file NIImporter_VISUM.h.

Referenced by addParser(), and load().

◆ mySubPartsAreas

std::map<long long int, std::vector<long long int> > NIImporter_VISUM::mySubPartsAreas
private

A map from area parts to area ids.

Definition at line 519 of file NIImporter_VISUM.h.

Referenced by parse_AreaSubPartElement(), and parse_PartOfArea().

◆ myTLS

◆ myTouchedEdges

std::vector<std::string > NIImporter_VISUM::myTouchedEdges
private

Already read edges.

Definition at line 500 of file NIImporter_VISUM.h.

Referenced by parse_Edges().

◆ myUseVisumPrio

bool NIImporter_VISUM::myUseVisumPrio
private

Information whether VISUM priority information shall be used.

Definition at line 503 of file NIImporter_VISUM.h.

Referenced by parse_Edges().

◆ myVSysTypes

VSysTypeNames NIImporter_VISUM::myVSysTypes
private

The used vsystypes.

Definition at line 487 of file NIImporter_VISUM.h.

Referenced by parse_Turns(), and parse_VSysTypes().


The documentation for this class was generated from the following files: