![]() |
SUMO - Simulation of Urban MObility
|
Importer for networks stored in SUMO format. More...
#include <NIImporter_SUMO.h>
Data Structures | |
struct | Connection |
A connection description. More... | |
struct | Crossing |
Describes a pedestrian crossing. More... | |
struct | EdgeAttrs |
Describes the values found in an edge's definition and this edge's lanes. More... | |
struct | JunctionAttrs |
Describes the values found in a junction. More... | |
struct | LaneAttrs |
Describes the values found in a lane's definition. More... | |
struct | Prohibition |
Describes the values found in a prohibition. More... | |
Public Member Functions | |
void | characters (const XMLCh *const chars, const XERCES3_SIZE_t length) |
The inherited method called when characters occured. More... | |
void | endElement (const XMLCh *const uri, const XMLCh *const localname, const XMLCh *const qname) |
The inherited method called when a tag is being closed. More... | |
const std::string & | getFileName () const |
returns the current file name More... | |
void | registerParent (const int tag, GenericSAXHandler *handler) |
Assigning a parent handler which is enabled when the specified tag is closed. More... | |
void | setFileName (const std::string &name) |
Sets the current file name. More... | |
void | startElement (const XMLCh *const uri, const XMLCh *const localname, const XMLCh *const qname, const XERCES_CPP_NAMESPACE::Attributes &attrs) |
The inherited method called when a new tag opens. More... | |
SAX ErrorHandler callbacks | |
void | warning (const XERCES_CPP_NAMESPACE::SAXParseException &exception) |
Handler for XML-warnings. More... | |
void | error (const XERCES_CPP_NAMESPACE::SAXParseException &exception) |
Handler for XML-errors. More... | |
void | fatalError (const XERCES_CPP_NAMESPACE::SAXParseException &exception) |
Handler for XML-errors. More... | |
Static Public Member Functions | |
static void | addPhase (const SUMOSAXAttributes &attrs, NBLoadedSUMOTLDef *currentTL) |
adds a phase to the traffic lights logic currently build More... | |
static NBLoadedSUMOTLDef * | initTrafficLightLogic (const SUMOSAXAttributes &attrs, NBLoadedSUMOTLDef *currentTL) |
begins the reading of a traffic lights logic More... | |
static GeoConvHelper * | loadLocation (const SUMOSAXAttributes &attrs) |
Parses network location description and registers it with GeoConveHelper::setLoaded. More... | |
static void | loadNetwork (OptionsCont &oc, NBNetBuilder &nb) |
Loads content of the optionally given SUMO file. More... | |
Protected Member Functions | |
std::string | buildErrorMessage (const XERCES_CPP_NAMESPACE::SAXParseException &exception) |
Builds an error message. More... | |
virtual void | myCharacters (int element, const std::string &chars) |
Callback method for characters to implement by derived classes. More... | |
NIImporter_SUMO (NBNetBuilder &nb) | |
Constructor. More... | |
~NIImporter_SUMO () | |
Destructor. More... | |
inherited from GenericSAXHandler | |
void | myStartElement (int element, const SUMOSAXAttributes &attrs) |
Called on the opening of a tag;. More... | |
void | myEndElement (int element) |
Called when a closing tag occurs. More... | |
Private Member Functions | |
void | _loadNetwork (OptionsCont &oc) |
load the network More... | |
LaneAttrs * | getLaneAttrsFromID (EdgeAttrs *edge, std::string lane_id) |
Parses lane index from lane ID an retrieve lane from EdgeAttrs. More... | |
void | parseProhibitionConnection (const std::string &attr, std::string &from, std::string &to, bool &ok) |
parses connection string of a prohibition (very old school) More... | |
Object instance parsing methods | |
void | addEdge (const SUMOSAXAttributes &attrs) |
Parses an edge and stores the values in "myCurrentEdge". More... | |
void | addLane (const SUMOSAXAttributes &attrs) |
Parses a lane and stores the values in "myCurrentLane". More... | |
void | addJunction (const SUMOSAXAttributes &attrs) |
Parses a junction and saves it in the node control. More... | |
void | addRequest (const SUMOSAXAttributes &attrs) |
Parses a reques and saves selected attributes in myCurrentJunction. More... | |
void | addConnection (const SUMOSAXAttributes &attrs) |
Parses a connection and saves it into the lane's definition stored in "myCurrentLane". More... | |
void | addProhibition (const SUMOSAXAttributes &attrs) |
Parses a prohibition and saves it. More... | |
void | addRoundabout (const SUMOSAXAttributes &attrs) |
Parses a roundabout and stores it in myEdgeCont. More... | |
Static Private Member Functions | |
static void | interpretLaneID (const std::string &lane_id, std::string &edge_id, unsigned int &index) |
parses edge-id and index from lane-id More... | |
static Position | readPosition (const SUMOSAXAttributes &attrs, const std::string &id, bool &ok) |
read position from the given attributes, attribute errors to id More... | |
static PositionVector | reconstructEdgeShape (const EdgeAttrs *edge, const Position &from, const Position &to) |
reconstructs the edge shape from the node positions and the given lane shapes since we do not know the original LaneSpreadFunction this is only an approximation More... | |
Private Attributes | |
bool | myAmLefthand |
whether the loaded network was built for lefthand traffic More... | |
int | myCornerDetail |
the level of corner detail in the loaded network More... | |
EdgeAttrs * | myCurrentEdge |
The currently parsed edge's definition (to add loaded lanes to) More... | |
JunctionAttrs | myCurrentJunction |
The currently parsed junction definition to help in reconstructing crossings. More... | |
LaneAttrs * | myCurrentLane |
The currently parsed lanes's definition (to add the shape to) More... | |
NBLoadedSUMOTLDef * | myCurrentTL |
The currently parsed traffic light. More... | |
std::map< std::string, NBNode::CustomShapeMap > | myCustomShapeMaps |
customLaneShape (cannot be added to the NBNode when parsed since the node doesn't yet exist More... | |
std::map< std::string, EdgeAttrs * > | myEdges |
Loaded edge definitions. More... | |
bool | myHaveSeenInternalEdge |
whether the loaded network contains internal lanes More... | |
int | myLinkDetail |
the level of geometry detail for internal lanes in the loaded network More... | |
GeoConvHelper * | myLocation |
The coordinate transformation which was used to build the loaded network. More... | |
NBNetBuilder & | myNetBuilder |
The network builder to fill. More... | |
NBNodeCont & | myNodeCont |
The node container to fill. More... | |
std::map< std::string, std::vector< Crossing > > | myPedestrianCrossings |
The pedestrian crossings found in the network. More... | |
std::vector< Prohibition > | myProhibitions |
Loaded prohibitions. More... | |
std::set< std::string > | myRailSignals |
list of node id with rail signals (no NBTrafficLightDefinition exists) More... | |
std::vector< std::vector< std::string > > | myRoundabouts |
loaded roundabout edges More... | |
NBTrafficLightLogicCont & | myTLLCont |
The node container to fill. More... | |
Importer for networks stored in SUMO format.
Definition at line 58 of file NIImporter_SUMO.h.
|
protected |
Constructor.
[in] | nc | The network builder to fill |
Definition at line 77 of file NIImporter_SUMO.cpp.
|
protected |
Destructor.
Definition at line 93 of file NIImporter_SUMO.cpp.
References NIImporter_SUMO::EdgeAttrs::lanes, myEdges, and myLocation.
|
private |
load the network
Definition at line 106 of file NIImporter_SUMO.cpp.
References NBLoadedSUMOTLDef::addConnection(), NBNode::addCrossing(), NBEdge::addLane2LaneConnection(), NBEdgeCont::addRoundabout(), NBNode::addSortedLinkFoes(), NIImporter_SUMO::LaneAttrs::allow, NIImporter_SUMO::EdgeAttrs::builtEdge, NIImporter_SUMO::LaneAttrs::connections, NIImporter_SUMO::Connection::contPos, NIImporter_SUMO::Crossing::crossingEdges, NBEdge::declareConnectionsAsLoaded(), deprecatedVehicleClassesSeen, NIImporter_SUMO::LaneAttrs::disallow, EDGEFUNC_CROSSING, EDGEFUNC_INTERNAL, EDGEFUNC_WALKINGAREA, NIImporter_SUMO::LaneAttrs::endOffset, NIImporter_SUMO::EdgeAttrs::fromNode, NIImporter_SUMO::EdgeAttrs::func, OptionsCont::getBool(), NBNetBuilder::getEdgeCont(), NBEdge::getEndOffset(), Named::getID(), NBEdge::getLaneID(), NBEdge::getLanes(), NBEdge::getLaneWidth(), NBNode::getPosition(), NBTrafficLightLogicCont::getPrograms(), OptionsCont::getStringVector(), NBEdge::getToNode(), NBEdge::hasConnectionTo(), NBEdge::hasLaneSpecificEndOffset(), NBEdge::hasLaneSpecificWidth(), NBNetBuilder::haveLoadedNetworkWithoutInternalEdges(), NIImporter_SUMO::EdgeAttrs::id, NBEdgeCont::insert(), OptionsCont::isDefault(), FileHelpers::isReadable(), OptionsCont::isUsableFileList(), NIImporter_SUMO::Connection::keepClear, NBEdge::L2L_VALIDATED, NIImporter_SUMO::EdgeAttrs::lanes, NIImporter_SUMO::EdgeAttrs::length, NIImporter_SUMO::EdgeAttrs::lsf, NIImporter_SUMO::LaneAttrs::maxSpeed, NIImporter_SUMO::EdgeAttrs::maxSpeed, NIImporter_SUMO::Connection::mayDefinitelyPass, myAmLefthand, myCornerDetail, myEdges, myHaveSeenInternalEdge, myLinkDetail, myNetBuilder, myNodeCont, myPedestrianCrossings, myProhibitions, myRailSignals, myRoundabouts, myTLLCont, parseVehicleClasses(), NIImporter_SUMO::EdgeAttrs::priority, NIImporter_SUMO::Crossing::priority, PROGRESS_BEGIN_MESSAGE, PROGRESS_DONE_MESSAGE, reconstructEdgeShape(), NBNodeCont::retrieve(), NBEdgeCont::retrieve(), XMLSubSys::runParser(), OptionsCont::set(), NBEdge::setEndOffset(), GenericSAXHandler::setFileName(), NBEdge::setLaneWidth(), NBEdge::setLoadedLength(), NBEdge::setPermissions(), NBEdge::setSpeed(), NIImporter_SUMO::EdgeAttrs::shape, NIImporter_SUMO::EdgeAttrs::streetName, NIImporter_SUMO::Connection::tlID, NIImporter_SUMO::Connection::tlLinkNo, NIImporter_SUMO::Connection::toEdgeID, NIImporter_SUMO::Connection::toLaneIdx, NIImporter_SUMO::EdgeAttrs::toNode, toString(), NIImporter_SUMO::EdgeAttrs::type, NBEdge::UNSPECIFIED_OFFSET, NBEdge::UNSPECIFIED_WIDTH, NBEdgeCont::wasIgnored(), NIImporter_SUMO::LaneAttrs::width, NIImporter_SUMO::Crossing::width, WRITE_ERROR, and WRITE_WARNING.
Referenced by loadNetwork().
|
private |
Parses a connection and saves it into the lane's definition stored in "myCurrentLane".
[in] | attrs | The attributes to get the connection from |
Definition at line 558 of file NIImporter_SUMO.cpp.
References NIImporter_SUMO::Connection::contPos, EDGEFUNC_CROSSING, EDGEFUNC_WALKINGAREA, NIImporter_SUMO::EdgeAttrs::func, SUMOSAXAttributes::get(), StringBijection< T >::get(), SUMOXMLDefinitions::getJunctionIDFromInternalEdge(), SUMOSAXAttributes::getOpt(), NIImporter_SUMO::Connection::keepClear, NIImporter_SUMO::EdgeAttrs::lanes, LINKSTATE_MAJOR, SUMOXMLDefinitions::LinkStates, NIImporter_SUMO::Connection::mayDefinitelyPass, myEdges, myPedestrianCrossings, SUMO_ATTR_CONTPOS, SUMO_ATTR_FROM, SUMO_ATTR_FROM_LANE, SUMO_ATTR_KEEP_CLEAR, SUMO_ATTR_PASS, SUMO_ATTR_STATE, SUMO_ATTR_TLID, SUMO_ATTR_TLLINKINDEX, SUMO_ATTR_TO, SUMO_ATTR_TO_LANE, SUMOReal, NIImporter_SUMO::Connection::tlID, NIImporter_SUMO::Connection::tlLinkNo, NIImporter_SUMO::Connection::toEdgeID, NIImporter_SUMO::Connection::toLaneIdx, toString(), NBEdge::UNSPECIFIED_CONTPOS, and WRITE_ERROR.
Referenced by myStartElement().
|
private |
Parses an edge and stores the values in "myCurrentEdge".
[in] | attrs | The attributes to get the edge's values from |
Definition at line 398 of file NIImporter_SUMO.cpp.
References NIImporter_SUMO::EdgeAttrs::builtEdge, NIImporter_SUMO::Crossing::crossingEdges, EDGEFUNC_CROSSING, EDGEFUNC_INTERNAL, EDGEFUNC_WALKINGAREA, NIImporter_SUMO::Crossing::edgeID, NIImporter_SUMO::EdgeAttrs::fromNode, NIImporter_SUMO::EdgeAttrs::func, SUMOSAXAttributes::get(), StringBijection< T >::get(), SUMOSAXAttributes::getEdgeFunc(), SUMOXMLDefinitions::getJunctionIDFromInternalEdge(), SUMOSAXAttributes::getOpt(), OptionsCont::getOptions(), NIImporter_SUMO::EdgeAttrs::id, OptionsCont::isDefault(), LANESPREAD_RIGHT, SUMOXMLDefinitions::LaneSpreadFunctions, NIImporter_SUMO::EdgeAttrs::length, NIImporter_SUMO::EdgeAttrs::lsf, NIImporter_SUMO::EdgeAttrs::maxSpeed, myCurrentEdge, myLocation, myPedestrianCrossings, SUMOSAXAttributes::parseStringVector(), NIImporter_SUMO::EdgeAttrs::priority, OptionsCont::set(), NIImporter_SUMO::EdgeAttrs::shape, NIImporter_SUMO::EdgeAttrs::streetName, SUMO_ATTR_CROSSING_EDGES, SUMO_ATTR_FROM, SUMO_ATTR_ID, SUMO_ATTR_LENGTH, SUMO_ATTR_NAME, SUMO_ATTR_PRIORITY, SUMO_ATTR_SHAPE, SUMO_ATTR_SPREADTYPE, SUMO_ATTR_TO, SUMO_ATTR_TYPE, SUMOReal, NIImporter_SUMO::EdgeAttrs::toNode, toString(), NBNetBuilder::transformCoordinates(), NIImporter_SUMO::EdgeAttrs::type, NBEdge::UNSPECIFIED_LOADED_LENGTH, and WRITE_ERROR.
Referenced by myStartElement().
|
private |
Parses a junction and saves it in the node control.
[in] | attrs | The attributes to get the junction's values from |
Definition at line 494 of file NIImporter_SUMO.cpp.
References SUMOSAXAttributes::get(), SUMOSAXAttributes::getNodeType(), SUMOSAXAttributes::getOpt(), SUMOSAXAttributes::hasAttribute(), NBNodeCont::insert(), NIImporter_SUMO::JunctionAttrs::intLanes, myCurrentJunction, myCustomShapeMaps, myLocation, myNodeCont, myRailSignals, NIImporter_SUMO::JunctionAttrs::node, NODETYPE_DEAD_END, NODETYPE_DEAD_END_DEPRECATED, NODETYPE_RAIL_CROSSING, NODETYPE_RAIL_SIGNAL, NODETYPE_UNKNOWN, SUMOSAXAttributes::parseStringVector(), readPosition(), NIImporter_SUMO::JunctionAttrs::response, NBNode::setCustomLaneShape(), NBNode::setCustomShape(), NBNode::setRadius(), SUMO_ATTR_CUSTOMSHAPE, SUMO_ATTR_ID, SUMO_ATTR_INTLANES, SUMO_ATTR_RADIUS, SUMO_ATTR_SHAPE, SUMOReal, NBNetBuilder::transformCoordinates(), WRITE_ERROR, and WRITE_WARNING.
Referenced by myStartElement().
|
private |
Parses a lane and stores the values in "myCurrentLane".
[in] | attrs | The attributes to get the lane's values from |
Definition at line 447 of file NIImporter_SUMO.cpp.
References EDGEFUNC_CROSSING, EDGEFUNC_INTERNAL, EDGEFUNC_WALKINGAREA, NIImporter_SUMO::EdgeAttrs::func, SUMOSAXAttributes::get(), SUMOSAXAttributes::getFloat(), SUMOXMLDefinitions::getJunctionIDFromInternalEdge(), NBNode::getNodeIDFromInternalLane(), SUMOSAXAttributes::getOpt(), SUMOSAXAttributes::hasAttribute(), NIImporter_SUMO::EdgeAttrs::id, myCurrentEdge, myCurrentLane, myCustomShapeMaps, myHaveSeenInternalEdge, myLocation, myPedestrianCrossings, SUMO_ATTR_ALLOW, SUMO_ATTR_CUSTOMSHAPE, SUMO_ATTR_DISALLOW, SUMO_ATTR_ENDOFFSET, SUMO_ATTR_ID, SUMO_ATTR_SHAPE, SUMO_ATTR_SPEED, SUMO_ATTR_WIDTH, SUMOReal, NBNetBuilder::transformCoordinates(), NBEdge::UNSPECIFIED_OFFSET, NBEdge::UNSPECIFIED_WIDTH, and WRITE_ERROR.
Referenced by myStartElement().
|
static |
adds a phase to the traffic lights logic currently build
Definition at line 679 of file NIImporter_SUMO.cpp.
References NBLoadedSUMOTLDef::addPhase(), SUMOSAXAttributes::get(), Named::getID(), NBTrafficLightDefinition::getProgramID(), SUMO_ATTR_DURATION, SUMO_ATTR_STATE, SUMOReal, TIME2STEPS, and WRITE_ERROR.
Referenced by NIXMLTrafficLightsHandler::myStartElement(), and myStartElement().
|
private |
Parses a prohibition and saves it.
[in] | attrs | The attributes to get the connection from |
Definition at line 603 of file NIImporter_SUMO.cpp.
References SUMOSAXAttributes::getOpt(), myProhibitions, parseProhibitionConnection(), NIImporter_SUMO::Prohibition::prohibitedFrom, NIImporter_SUMO::Prohibition::prohibitedTo, NIImporter_SUMO::Prohibition::prohibitorFrom, NIImporter_SUMO::Prohibition::prohibitorTo, SUMO_ATTR_PROHIBITED, and SUMO_ATTR_PROHIBITOR.
Referenced by myStartElement().
|
private |
Parses a reques and saves selected attributes in myCurrentJunction.
[in] | attrs | The attributes to get the junction's values from |
Definition at line 549 of file NIImporter_SUMO.cpp.
References SUMOSAXAttributes::get(), myCurrentJunction, NIImporter_SUMO::JunctionAttrs::node, NIImporter_SUMO::JunctionAttrs::response, and SUMO_ATTR_RESPONSE.
Referenced by myStartElement().
|
private |
Parses a roundabout and stores it in myEdgeCont.
[in] | attrs | The attributes to get the roundabouts values from |
Definition at line 800 of file NIImporter_SUMO.cpp.
References SUMOSAXAttributes::getStringVector(), SUMOSAXAttributes::hasAttribute(), myRoundabouts, SUMO_ATTR_EDGES, and WRITE_ERROR.
Referenced by myStartElement().
|
protectedinherited |
Builds an error message.
The error message includes the file name and the line/column information as supported by the given SAXParseException
[in] | exception | The name of the currently processed file |
Definition at line 193 of file GenericSAXHandler.cpp.
References GenericSAXHandler::getFileName().
Referenced by GenericSAXHandler::error(), GenericSAXHandler::fatalError(), and GenericSAXHandler::warning().
|
inherited |
The inherited method called when characters occured.
The retrieved characters are converted into a string and appended into a private buffer. They are reported as soon as the element ends.
recheck/describe what happens with characters when a new element is opened
describe characters processing in the class' head
Definition at line 176 of file GenericSAXHandler.cpp.
References TplConvert::_2str(), and GenericSAXHandler::myCharactersVector.
|
inherited |
The inherited method called when a tag is being closed.
This method calls the user-implemented methods myCharacters with the previously collected and converted characters.
Then, myEndElement is called, supplying it the qname converted to its enum- and string-representations.
recheck/describe encoding of the string-representation
do not generate and report the string-representation
Definition at line 126 of file GenericSAXHandler.cpp.
References TplConvert::_2str(), GenericSAXHandler::convertTag(), GenericSAXHandler::myCharacters(), GenericSAXHandler::myCharactersVector, GenericSAXHandler::myEndElement(), GenericSAXHandler::myParentHandler, GenericSAXHandler::myParentIndicator, XMLSubSys::setHandler(), SUMO_TAG_INCLUDE, and SUMO_TAG_NOTHING.
|
inherited |
Handler for XML-errors.
The message is built using buildErrorMessage and thrown within a ProcessError.
[in] | exception | The occured exception to process |
ProcessError | On any call |
Definition at line 212 of file GenericSAXHandler.cpp.
References GenericSAXHandler::buildErrorMessage().
Referenced by MSRouteHandler::closeContainer(), MSRouteHandler::closePerson(), NIImporter_OpenDrive::geomFromSpiral(), MSRouteHandler::myStartElement(), and MSRouteHandler::parseWalkPos().
|
inherited |
Handler for XML-errors.
The message is built using buildErrorMessage and thrown within a ProcessError.
ProcessError | On any call |
[in] | exception | The occured exception to process |
Definition at line 218 of file GenericSAXHandler.cpp.
References GenericSAXHandler::buildErrorMessage().
|
inherited |
returns the current file name
Definition at line 86 of file GenericSAXHandler.cpp.
References GenericSAXHandler::myFileName.
Referenced by NLHandler::addE1Detector(), NLHandler::addE2Detector(), NLHandler::addEdgeLaneMeanData(), NLHandler::addInstantE1Detector(), ShapeHandler::addPOI(), ShapeHandler::addPoly(), NLHandler::addRouteProbeDetector(), NLHandler::addVTypeProbeDetector(), NLHandler::beginE3Detector(), GenericSAXHandler::buildErrorMessage(), PCNetProjectionLoader::load(), NILoader::loadXMLType(), NLHandler::myEndElement(), RODFDetectorHandler::myStartElement(), GUISettingsHandler::myStartElement(), MSStateHandler::myStartElement(), SUMORouteHandler::myStartElement(), PCLoaderXML::myStartElement(), NLHandler::myStartElement(), NIImporter_OpenDrive::myStartElement(), XMLSubSys::runParser(), GenericSAXHandler::startElement(), and SUMORouteLoader::SUMORouteLoader().
|
private |
Parses lane index from lane ID an retrieve lane from EdgeAttrs.
[in] | edge | The EdgeAttrs* which should contain the lane |
[in] | lane_id | The ID of the lane |
Definition at line 621 of file NIImporter_SUMO.cpp.
References NIImporter_SUMO::EdgeAttrs::id, interpretLaneID(), NIImporter_SUMO::EdgeAttrs::lanes, and WRITE_ERROR.
|
static |
begins the reading of a traffic lights logic
Definition at line 653 of file NIImporter_SUMO.cpp.
References SUMOSAXAttributes::get(), StringBijection< T >::get(), Named::getID(), SUMOSAXAttributes::getOpt(), SUMO_ATTR_ID, SUMO_ATTR_OFFSET, SUMO_ATTR_PROGRAMID, SUMO_ATTR_TYPE, SUMOReal, TIME2STEPS, SUMOXMLDefinitions::TrafficLightTypes, and WRITE_ERROR.
Referenced by myStartElement().
|
staticprivate |
parses edge-id and index from lane-id
[in] | lane_id | The lane-id |
[out] | edge_id | ID of this lane's edge |
[out] | index | Index of this lane |
Definition at line 636 of file NIImporter_SUMO.cpp.
References TplConvert::_2int(), and WRITE_ERROR.
Referenced by getLaneAttrsFromID().
|
static |
Parses network location description and registers it with GeoConveHelper::setLoaded.
Definition at line 741 of file NIImporter_SUMO.cpp.
References SUMOSAXAttributes::get(), GeoConvHelper::setLoaded(), SUMO_ATTR_CONV_BOUNDARY, SUMO_ATTR_NET_OFFSET, SUMO_ATTR_ORIG_BOUNDARY, and SUMO_ATTR_ORIG_PROJ.
Referenced by NIXMLNodesHandler::myStartElement(), and myStartElement().
|
static |
Loads content of the optionally given SUMO file.
If the option "sumo-net-file" is set, the file stored therein is read and the network definition stored therein is stored within the given network builder.
If the option "sumo-net-file" is not set, this method simply returns.
The loading is done by parsing the network definition as an XML file using the SAXinterface and handling the incoming data via this class' methods.
[in,out] | oc | The options to use (option no-internal-links may be modified) |
[in] | nb | The network builder to fill |
Definition at line 68 of file NIImporter_SUMO.cpp.
References _loadNetwork().
Referenced by NILoader::load().
|
protectedvirtualinherited |
Callback method for characters to implement by derived classes.
Called by "endElement" (see there).
[in] | element | The opened element, given as a int |
[in] | chars | The complete embedded character string ProcessError These method may throw a ProcessError if something fails |
Reimplemented in NIImporter_ITSUMO::Handler.
Definition at line 228 of file GenericSAXHandler.cpp.
Referenced by GenericSAXHandler::endElement().
|
protectedvirtual |
Called when a closing tag occurs.
[in] | element | ID of the currently opened element |
ProcessError | If something fails |
Reimplemented from GenericSAXHandler.
Definition at line 363 of file NIImporter_SUMO.cpp.
References Named::getID(), NBTrafficLightDefinition::getProgramID(), NIImporter_SUMO::EdgeAttrs::id, NBTrafficLightLogicCont::insert(), NIImporter_SUMO::EdgeAttrs::lanes, MAX2(), NIImporter_SUMO::LaneAttrs::maxSpeed, NIImporter_SUMO::EdgeAttrs::maxSpeed, myCurrentEdge, myCurrentLane, myCurrentTL, myEdges, myTLLCont, SUMO_TAG_EDGE, SUMO_TAG_LANE, SUMO_TAG_TLLOGIC, WRITE_ERROR, and WRITE_WARNING.
|
protectedvirtual |
Called on the opening of a tag;.
In dependence to the obtained type, an appropriate parsing method is called ("addEdge" if an edge encounters, f.e.).
[in] | element | ID of the currently opened element |
[in] | attrs | Attributes within the currently opened element |
ProcessError | If something fails |
Reimplemented from GenericSAXHandler.
Definition at line 302 of file NIImporter_SUMO.cpp.
References addConnection(), addEdge(), addJunction(), addLane(), addPhase(), addProhibition(), addRequest(), addRoundabout(), SUMOSAXAttributes::getOpt(), initTrafficLightLogic(), loadLocation(), myAmLefthand, myCornerDetail, myCurrentTL, myLinkDetail, myLocation, SUMO_ATTR_CORNERDETAIL, SUMO_ATTR_LEFTHAND, SUMO_ATTR_LINKDETAIL, SUMO_TAG_CONNECTION, SUMO_TAG_EDGE, SUMO_TAG_JUNCTION, SUMO_TAG_LANE, SUMO_TAG_LOCATION, SUMO_TAG_NET, SUMO_TAG_PHASE, SUMO_TAG_PROHIBITION, SUMO_TAG_REQUEST, SUMO_TAG_ROUNDABOUT, and SUMO_TAG_TLLOGIC.
|
private |
parses connection string of a prohibition (very old school)
[in] | attr | The connection attribute |
[out] | from | ID of the source edge |
[out] | to | ID of the destination edge |
[out] | ok | Whether parsing completed successfully |
Definition at line 771 of file NIImporter_SUMO.cpp.
References myEdges, and WRITE_ERROR.
Referenced by addProhibition().
|
staticprivate |
read position from the given attributes, attribute errors to id
Definition at line 759 of file NIImporter_SUMO.cpp.
References SUMOSAXAttributes::get(), SUMOSAXAttributes::hasAttribute(), SUMO_ATTR_X, SUMO_ATTR_Y, SUMO_ATTR_Z, and SUMOReal.
Referenced by addJunction().
|
staticprivate |
reconstructs the edge shape from the node positions and the given lane shapes since we do not know the original LaneSpreadFunction this is only an approximation
[in] | lanes | The list of lane attributes |
= -2.; //
Definition at line 703 of file NIImporter_SUMO.cpp.
References PositionVector::extrapolate(), NIImporter_SUMO::EdgeAttrs::id, PositionVector::intersectionPosition2D(), PositionVector::intersects(), NIImporter_SUMO::EdgeAttrs::lanes, LANESPREAD_RIGHT, NIImporter_SUMO::EdgeAttrs::lsf, PositionVector::sideOffset(), SUMO_const_laneOffset, SUMO_const_laneWidth, SUMOReal, and WRITE_WARNING.
Referenced by _loadNetwork().
|
inherited |
Assigning a parent handler which is enabled when the specified tag is closed.
Definition at line 168 of file GenericSAXHandler.cpp.
References GenericSAXHandler::myParentHandler, GenericSAXHandler::myParentIndicator, and XMLSubSys::setHandler().
Referenced by NLTriggerBuilder::parseAndBuildCalibrator(), NLTriggerBuilder::parseAndBuildLaneSpeedTrigger(), and NLTriggerBuilder::parseAndBuildRerouter().
|
inherited |
Sets the current file name.
[in] | name | The name of the currently processed file |
Definition at line 80 of file GenericSAXHandler.cpp.
References GenericSAXHandler::myFileName.
Referenced by _loadNetwork(), GUISettingsHandler::GUISettingsHandler(), PCNetProjectionLoader::load(), NIImporter_OpenStreetMap::load(), loadNet(), ROLoader::loadNet(), NIImporter_ITSUMO::loadNetwork(), NIImporter_MATSim::loadNetwork(), NIImporter_Vissim::loadXML(), NILoader::loadXMLType(), main(), and XMLSubSys::runParser().
|
inherited |
The inherited method called when a new tag opens.
The method parses the supplied XMLCh*-qname using the internal name/enum-map to obtain the enum representation of the attribute name.
Then, "myStartElement" is called supplying the enumeration value, the string-representation of the name and the attributes.
recheck/describe encoding of the string-representation
do not generate and report the string-representation
Definition at line 105 of file GenericSAXHandler.cpp.
References TplConvert::_2str(), GenericSAXHandler::convertTag(), FileHelpers::getConfigurationRelative(), GenericSAXHandler::getFileName(), SUMOSAXAttributesImpl_Xerces::getString(), FileHelpers::isAbsolute(), GenericSAXHandler::myCharactersVector, GenericSAXHandler::myPredefinedTags, GenericSAXHandler::myPredefinedTagsMML, GenericSAXHandler::myStartElement(), XMLSubSys::runParser(), SUMO_ATTR_HREF, and SUMO_TAG_INCLUDE.
|
inherited |
Handler for XML-warnings.
The message is built using buildErrorMessage and reported to the warning-instance of the MsgHandler.
[in] | exception | The occured exception to process |
Definition at line 206 of file GenericSAXHandler.cpp.
References GenericSAXHandler::buildErrorMessage(), and WRITE_WARNING.
|
private |
whether the loaded network was built for lefthand traffic
Definition at line 321 of file NIImporter_SUMO.h.
Referenced by _loadNetwork(), and myStartElement().
|
private |
the level of corner detail in the loaded network
Definition at line 324 of file NIImporter_SUMO.h.
Referenced by _loadNetwork(), and myStartElement().
|
private |
The currently parsed edge's definition (to add loaded lanes to)
Definition at line 300 of file NIImporter_SUMO.h.
Referenced by addEdge(), addLane(), and myEndElement().
|
private |
The currently parsed junction definition to help in reconstructing crossings.
Definition at line 303 of file NIImporter_SUMO.h.
Referenced by addJunction(), and addRequest().
|
private |
The currently parsed lanes's definition (to add the shape to)
Definition at line 306 of file NIImporter_SUMO.h.
Referenced by addLane(), and myEndElement().
|
private |
The currently parsed traffic light.
Definition at line 309 of file NIImporter_SUMO.h.
Referenced by myEndElement(), and myStartElement().
|
private |
customLaneShape (cannot be added to the NBNode when parsed since the node doesn't yet exist
Definition at line 333 of file NIImporter_SUMO.h.
Referenced by addJunction(), and addLane().
|
private |
Loaded edge definitions.
Definition at line 285 of file NIImporter_SUMO.h.
Referenced by _loadNetwork(), addConnection(), myEndElement(), parseProhibitionConnection(), and ~NIImporter_SUMO().
|
private |
whether the loaded network contains internal lanes
Definition at line 318 of file NIImporter_SUMO.h.
Referenced by _loadNetwork(), and addLane().
|
private |
the level of geometry detail for internal lanes in the loaded network
Definition at line 327 of file NIImporter_SUMO.h.
Referenced by _loadNetwork(), and myStartElement().
|
private |
The coordinate transformation which was used to build the loaded network.
Definition at line 312 of file NIImporter_SUMO.h.
Referenced by addEdge(), addJunction(), addLane(), myStartElement(), and ~NIImporter_SUMO().
|
private |
The network builder to fill.
Definition at line 291 of file NIImporter_SUMO.h.
Referenced by _loadNetwork().
|
private |
The node container to fill.
Definition at line 294 of file NIImporter_SUMO.h.
Referenced by _loadNetwork(), and addJunction().
|
private |
The pedestrian crossings found in the network.
Definition at line 315 of file NIImporter_SUMO.h.
Referenced by _loadNetwork(), addConnection(), addEdge(), and addLane().
|
private |
Loaded prohibitions.
Definition at line 288 of file NIImporter_SUMO.h.
Referenced by _loadNetwork(), and addProhibition().
|
private |
list of node id with rail signals (no NBTrafficLightDefinition exists)
Definition at line 336 of file NIImporter_SUMO.h.
Referenced by _loadNetwork(), and addJunction().
|
private |
loaded roundabout edges
Definition at line 330 of file NIImporter_SUMO.h.
Referenced by _loadNetwork(), and addRoundabout().
|
private |
The node container to fill.
Definition at line 297 of file NIImporter_SUMO.h.
Referenced by _loadNetwork(), and myEndElement().