![]() |
Eclipse 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... | |
struct | WalkingAreaParsedCustomShape |
Describes custom shape for a walking area during parsing. More... | |
Public Member Functions | |
void | characters (const XMLCh *const chars, const XERCES3_SIZE_t length) |
The inherited method called when characters occurred. 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... | |
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 | |
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... | |
void | _loadNetwork (OptionsCont &oc) |
load the network More... | |
Object instance parsing methods | |
std::map< std::string, EdgeAttrs * > | myEdges |
Loaded edge definitions. More... | |
std::vector< Prohibition > | myProhibitions |
Loaded prohibitions. More... | |
NBNetBuilder & | myNetBuilder |
The network builder to fill. More... | |
NBNodeCont & | myNodeCont |
The node container to fill. More... | |
NBTrafficLightLogicCont & | myTLLCont |
The node container to fill. More... | |
NIXMLTypesHandler | myTypesHandler |
The handler for parsing edge types and restrictions. 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... | |
GeoConvHelper * | myLocation |
The coordinate transformation which was used to build the loaded network. More... | |
std::map< std::string, std::vector< Crossing > > | myPedestrianCrossings |
The pedestrian crossings found in the network. More... | |
std::map< std::string, WalkingAreaParsedCustomShape > | myWACustomShapes |
Map from walkingArea edge IDs to custom shapes. More... | |
std::vector< Parameterised * > | myLastParameterised |
element to receive parameters More... | |
double | myNetworkVersion |
the loaded network version More... | |
bool | myHaveSeenInternalEdge |
whether the loaded network contains internal lanes More... | |
bool | myAmLefthand |
whether the loaded network was built for lefthand traffic More... | |
int | myCornerDetail |
the level of corner detail in the loaded network More... | |
int | myLinkDetail |
the level of geometry detail for internal lanes in the loaded network More... | |
bool | myRectLaneCut |
whether all lanes of an edge should have the same stop line More... | |
bool | myWalkingAreas |
whether walkingareas must be built More... | |
double | myLimitTurnSpeed |
whether turning speed was limited in the network More... | |
bool | myCheckLaneFoesAll |
whether foe-relationships where checked at lane-level More... | |
bool | myCheckLaneFoesRoundabout |
std::vector< std::vector< std::string > > | myRoundabouts |
loaded roundabout edges More... | |
std::set< std::string > | myRailSignals |
list of node id with rail signals (no NBTrafficLightDefinition exists) More... | |
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 | addStopOffsets (const SUMOSAXAttributes &attrs, bool &ok) |
parses stop offsets for the current lane or edge 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... | |
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... | |
static Position | readPosition (const SUMOSAXAttributes &attrs, const std::string &id, bool &ok) |
read position from the given attributes, attribute errors to id More... | |
SAX ErrorHandler callbacks | |
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... | |
void | setSchemaSeen (const bool schemaSeen=true) |
XMLCh * | convert (const std::string &name) const |
converts from c++-string into unicode More... | |
int | convertTag (const std::string &tag) const |
Converts a tag from its string into its numerical representation. More... | |
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... | |
attributes parsing | |
AttrMap | myPredefinedTags |
std::map< int, std::string > | myPredefinedTagsMML |
the map from ids to their string representation More... | |
typedef std::map< int, XMLCh * > | AttrMap |
elements parsing | |
TagMap | myTagMap |
std::vector< std::string > | myCharactersVector |
A list of character strings obtained so far to build the complete characters string at the end. More... | |
GenericSAXHandler * | myParentHandler |
The handler to give control back to. More... | |
int | myParentIndicator |
The tag indicating that control should be given back. More... | |
std::string | myFileName |
The name of the currently parsed file. More... | |
std::string | myExpectedRoot |
The root element to expect, empty string disables the check. More... | |
bool | mySchemaSeen |
whether the reader has already seen a schema More... | |
typedef std::map< std::string, int > | TagMap |
Importer for networks stored in SUMO format.
Definition at line 52 of file NIImporter_SUMO.h.
|
privateinherited |
Definition at line 285 of file GenericSAXHandler.h.
|
privateinherited |
Definition at line 299 of file GenericSAXHandler.h.
|
protected |
Constructor.
[in] | nc | The network builder to fill |
Definition at line 66 of file NIImporter_SUMO.cpp.
|
protected |
Destructor.
Definition at line 89 of file NIImporter_SUMO.cpp.
References NIImporter_SUMO::EdgeAttrs::lanes, myEdges, and myLocation.
|
private |
load the network
Definition at line 103 of file NIImporter_SUMO.cpp.
References NIImporter_SUMO::LaneAttrs::accelRamp, NBLoadedSUMOTLDef::addConnection(), NBNode::addCrossing(), NBNetBuilder::addGeometrySegments(), NBEdge::addLane2LaneConnection(), NBEdgeCont::addRoundabout(), NBNode::addSortedLinkFoes(), NBNode::addWalkingAreaShape(), NIImporter_SUMO::LaneAttrs::allow, NIImporter_SUMO::EdgeAttrs::builtEdge, NIImporter_SUMO::LaneAttrs::connections, NIImporter_SUMO::Crossing::crossingEdges, NIImporter_SUMO::LaneAttrs::customShape, NIImporter_SUMO::Crossing::customShape, NIImporter_SUMO::Crossing::customTLIndex, NIImporter_SUMO::Crossing::customTLIndex2, NBEdge::declareConnectionsAsLoaded(), deprecatedVehicleClassesSeen, NIImporter_SUMO::LaneAttrs::disallow, NIImporter_SUMO::EdgeAttrs::distance, EDGEFUNC_CROSSING, EDGEFUNC_INTERNAL, EDGEFUNC_WALKINGAREA, NIImporter_SUMO::LaneAttrs::endOffset, NBEdgeCont::erase(), NIImporter_SUMO::EdgeAttrs::fromNode, NIImporter_SUMO::EdgeAttrs::func, OptionsCont::getBool(), NBEdge::getConnectionRef(), NBNetBuilder::getDistrictCont(), NBNetBuilder::getEdgeCont(), NBEdge::getEndOffset(), OptionsCont::getFloat(), NBEdge::getID(), SUMOXMLDefinitions::getJunctionIDFromInternalEdge(), NBEdge::getLaneID(), NBEdge::getLanes(), NBEdge::getLaneStruct(), NBEdge::getLaneWidth(), Parameterised::getParametersMap(), NBNode::getPosition(), NBTrafficLightLogicCont::getPrograms(), NBEdge::getStopOffsets(), OptionsCont::getStringVector(), NBEdge::getToNode(), NBNode::getType(), NBEdge::hasConnectionTo(), NBEdge::hasLaneSpecificEndOffset(), NBEdge::hasLaneSpecificStopOffsets(), NBEdge::hasLaneSpecificWidth(), NIImporter_SUMO::EdgeAttrs::id, NBEdgeCont::ignore(), NBEdgeCont::ignoreFilterMatch(), NBEdgeCont::insert(), NBConnection::InvalidTlIndex, OptionsCont::isDefault(), FileHelpers::isReadable(), NBNode::isTrafficLight(), OptionsCont::isUsableFileList(), NBEdge::L2L_VALIDATED, NIImporter_SUMO::EdgeAttrs::lanes, NIImporter_SUMO::EdgeAttrs::length, NIImporter_SUMO::EdgeAttrs::lsf, NIImporter_SUMO::LaneAttrs::maxSpeed, NIImporter_SUMO::EdgeAttrs::maxSpeed, myAmLefthand, myCheckLaneFoesAll, myCheckLaneFoesRoundabout, myCornerDetail, myEdges, myHaveSeenInternalEdge, myLimitTurnSpeed, myLinkDetail, myNetBuilder, myNetworkVersion, myNodeCont, myPedestrianCrossings, myProhibitions, myRailSignals, myRectLaneCut, myRoundabouts, myTLLCont, myWACustomShapes, myWalkingAreas, NODETYPE_RAIL_SIGNAL, NBEdge::Lane::oppositeID, NIImporter_SUMO::LaneAttrs::oppositeID, parseVehicleClasses(), NIImporter_SUMO::EdgeAttrs::priority, NIImporter_SUMO::Crossing::priority, PROGRESS_BEGIN_MESSAGE, PROGRESS_DONE_MESSAGE, NBNodeCont::retrieve(), NBEdgeCont::retrieve(), XMLSubSys::runParser(), OptionsCont::set(), NBEdge::setAcceleration(), NBEdge::setDistance(), NBEdge::setEndOffset(), GenericSAXHandler::setFileName(), NBEdge::setLaneShape(), NBEdge::setLaneWidth(), NBEdge::setLoadedLength(), NBEdge::setPermissions(), NBEdge::setSpeed(), NBEdge::setStopOffsets(), NIImporter_SUMO::LaneAttrs::shape, NIImporter_SUMO::EdgeAttrs::shape, NIImporter_SUMO::LaneAttrs::stopOffsets, NIImporter_SUMO::EdgeAttrs::stopOffsets, NIImporter_SUMO::EdgeAttrs::streetName, NIImporter_SUMO::EdgeAttrs::toNode, toString(), NBEdge::Lane::type, NIImporter_SUMO::LaneAttrs::type, NIImporter_SUMO::EdgeAttrs::type, NBEdge::UNSPECIFIED_OFFSET, NBEdge::UNSPECIFIED_WIDTH, Parameterised::updateParameters(), 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 740 of file NIImporter_SUMO.cpp.
References NIImporter_SUMO::Connection::contPos, NIImporter_SUMO::Connection::customShape, EDGEFUNC_CROSSING, EDGEFUNC_NORMAL, EDGEFUNC_WALKINGAREA, PositionVector::EMPTY, NIImporter_SUMO::EdgeAttrs::func, SUMOSAXAttributes::get(), StringBijection< T >::get(), SUMOXMLDefinitions::getJunctionIDFromInternalEdge(), SUMOSAXAttributes::getOpt(), NBConnection::InvalidTlIndex, NIImporter_SUMO::Connection::keepClear, NIImporter_SUMO::EdgeAttrs::lanes, LINKSTATE_MAJOR, SUMOXMLDefinitions::LinkStates, NIImporter_SUMO::Connection::mayDefinitelyPass, myEdges, myLastParameterised, myLocation, myNetworkVersion, myPedestrianCrossings, myWACustomShapes, parseVehicleClasses(), NIImporter_SUMO::Connection::permissions, NIImporter_SUMO::Connection::speed, SUMO_ATTR_ALLOW, SUMO_ATTR_CONTPOS, SUMO_ATTR_DISALLOW, SUMO_ATTR_FROM, SUMO_ATTR_FROM_LANE, SUMO_ATTR_KEEP_CLEAR, SUMO_ATTR_PASS, SUMO_ATTR_SHAPE, SUMO_ATTR_SPEED, SUMO_ATTR_STATE, SUMO_ATTR_TLID, SUMO_ATTR_TLLINKINDEX, SUMO_ATTR_TLLINKINDEX2, SUMO_ATTR_TO, SUMO_ATTR_TO_LANE, SUMO_ATTR_UNCONTROLLED, SUMO_ATTR_VISIBILITY_DISTANCE, SVC_UNSPECIFIED, NIImporter_SUMO::Connection::tlID, NIImporter_SUMO::Connection::tlLinkIndex, NIImporter_SUMO::Connection::tlLinkIndex2, NIImporter_SUMO::Connection::toEdgeID, NIImporter_SUMO::Connection::toLaneIdx, toString(), NBNetBuilder::transformCoordinates(), NIImporter_SUMO::Connection::uncontrolled, NBEdge::UNSPECIFIED_CONNECTION_UNCONTROLLED, NBEdge::UNSPECIFIED_CONTPOS, NBEdge::UNSPECIFIED_SPEED, NBEdge::UNSPECIFIED_VISIBILITY_DISTANCE, NIImporter_SUMO::Connection::visibility, 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 530 of file NIImporter_SUMO.cpp.
References NIImporter_SUMO::EdgeAttrs::builtEdge, NIImporter_SUMO::Crossing::crossingEdges, NIImporter_SUMO::EdgeAttrs::distance, EDGEFUNC_CROSSING, EDGEFUNC_INTERNAL, EDGEFUNC_WALKINGAREA, 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, myHaveSeenInternalEdge, myLastParameterised, myLocation, myPedestrianCrossings, NIImporter_SUMO::EdgeAttrs::priority, OptionsCont::set(), NIImporter_SUMO::EdgeAttrs::shape, NIImporter_SUMO::EdgeAttrs::streetName, SUMO_ATTR_CROSSING_EDGES, SUMO_ATTR_DISTANCE, 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, 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 673 of file NIImporter_SUMO.cpp.
References SUMOSAXAttributes::get(), SUMOSAXAttributes::getFringeType(), SUMOSAXAttributes::getNodeType(), SUMOSAXAttributes::getOpt(), SUMOSAXAttributes::getRightOfWay(), SUMOSAXAttributes::hasAttribute(), NBNodeCont::insert(), NIImporter_SUMO::JunctionAttrs::intLanes, myCurrentJunction, myLastParameterised, myLocation, myNodeCont, myRailSignals, NIImporter_SUMO::JunctionAttrs::node, NODETYPE_DEAD_END, NODETYPE_DEAD_END_DEPRECATED, NODETYPE_RAIL_CROSSING, NODETYPE_RAIL_SIGNAL, NODETYPE_UNKNOWN, readPosition(), NIImporter_SUMO::JunctionAttrs::response, NBNode::setCustomShape(), NBNode::setFringeType(), NBNode::setRadius(), NBNode::setRightOfWay(), SUMO_ATTR_CUSTOMSHAPE, SUMO_ATTR_FRINGE, SUMO_ATTR_ID, SUMO_ATTR_INTLANES, SUMO_ATTR_RADIUS, SUMO_ATTR_RIGHT_OF_WAY, SUMO_ATTR_SHAPE, NBNetBuilder::transformCoordinate(), 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 581 of file NIImporter_SUMO.cpp.
References NIImporter_SUMO::LaneAttrs::accelRamp, NIImporter_SUMO::LaneAttrs::allow, NIImporter_SUMO::LaneAttrs::customShape, NIImporter_SUMO::LaneAttrs::disallow, EDGEFUNC_CROSSING, EDGEFUNC_INTERNAL, EDGEFUNC_WALKINGAREA, NIImporter_SUMO::LaneAttrs::endOffset, NIImporter_SUMO::EdgeAttrs::func, SUMOSAXAttributes::get(), SUMOSAXAttributes::getFloat(), SUMOXMLDefinitions::getJunctionIDFromInternalEdge(), SUMOSAXAttributes::getOpt(), SUMOSAXAttributes::hasAttribute(), NIImporter_SUMO::EdgeAttrs::id, NIImporter_SUMO::EdgeAttrs::lanes, NIImporter_SUMO::LaneAttrs::maxSpeed, myCurrentEdge, myCurrentLane, myLastParameterised, myLocation, myPedestrianCrossings, myWACustomShapes, NIImporter_SUMO::LaneAttrs::shape, NIImporter_SUMO::WalkingAreaParsedCustomShape::shape, SUMO_ATTR_ACCELERATION, SUMO_ATTR_ALLOW, SUMO_ATTR_CUSTOMSHAPE, SUMO_ATTR_DISALLOW, SUMO_ATTR_ENDOFFSET, SUMO_ATTR_ID, SUMO_ATTR_SHAPE, SUMO_ATTR_SPEED, SUMO_ATTR_TYPE, SUMO_ATTR_WIDTH, toString(), NBNetBuilder::transformCoordinates(), NIImporter_SUMO::LaneAttrs::type, NBEdge::UNSPECIFIED_OFFSET, NBEdge::UNSPECIFIED_WIDTH, NIImporter_SUMO::LaneAttrs::width, WRITE_ERROR, and WRITE_WARNING.
Referenced by myStartElement().
|
static |
adds a phase to the traffic lights logic currently build
Definition at line 904 of file NIImporter_SUMO.cpp.
References NBLoadedSUMOTLDef::addPhase(), SUMOSAXAttributes::get(), Named::getID(), SUMOSAXAttributes::getOpt(), SUMOSAXAttributes::getOptIntVector(), SUMOSAXAttributes::getOptSUMOTimeReporting(), NBTrafficLightDefinition::getProgramID(), SUMO_ATTR_DURATION, SUMO_ATTR_MAXDURATION, SUMO_ATTR_MINDURATION, SUMO_ATTR_NAME, SUMO_ATTR_NEXT, SUMO_ATTR_STATE, TIME2STEPS, NBTrafficLightDefinition::UNSPECIFIED_DURATION, 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 845 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 731 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 986 of file NIImporter_SUMO.cpp.
References SUMOSAXAttributes::getStringVector(), SUMOSAXAttributes::hasAttribute(), myRoundabouts, SUMO_ATTR_EDGES, and WRITE_ERROR.
Referenced by myStartElement().
|
private |
parses stop offsets for the current lane or edge
[in] | attrs | The attributes to get the stop offset sepcifics from |
Definition at line 643 of file NIImporter_SUMO.cpp.
References NIImporter_SUMO::EdgeAttrs::id, myCurrentEdge, myCurrentLane, parseStopOffsets(), NIImporter_SUMO::LaneAttrs::stopOffsets, NIImporter_SUMO::EdgeAttrs::stopOffsets, and WRITE_WARNING.
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 186 of file GenericSAXHandler.cpp.
References GenericSAXHandler::getFileName(), and transcode().
Referenced by GenericSAXHandler::error(), GenericSAXHandler::fatalError(), and GenericSAXHandler::warning().
|
inherited |
The inherited method called when characters occurred.
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 169 of file GenericSAXHandler.cpp.
References GenericSAXHandler::myCharactersVector, and StringUtils::transcode().
|
privateinherited |
converts from c++-string into unicode
[in] | name | The string to convert |
Definition at line 80 of file GenericSAXHandler.cpp.
Referenced by GenericSAXHandler::GenericSAXHandler().
|
privateinherited |
Converts a tag from its string into its numerical representation.
Returns the enum-representation stored for the given tag. If the tag is not known, SUMO_TAG_NOTHING is returned.
[in] | tag | The string to convert |
Definition at line 176 of file GenericSAXHandler.cpp.
References GenericSAXHandler::myTagMap, and SUMO_TAG_NOTHING.
Referenced by GenericSAXHandler::endElement(), and GenericSAXHandler::startElement().
|
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 120 of file GenericSAXHandler.cpp.
References GenericSAXHandler::convertTag(), GenericSAXHandler::myCharacters(), GenericSAXHandler::myCharactersVector, GenericSAXHandler::myEndElement(), GenericSAXHandler::myParentHandler, GenericSAXHandler::myParentIndicator, XMLSubSys::setHandler(), SUMO_TAG_INCLUDE, SUMO_TAG_NOTHING, and StringUtils::transcode().
|
inherited |
Handler for XML-errors.
The message is built using buildErrorMessage and thrown within a ProcessError.
[in] | exception | The occurred exception to process |
ProcessError | On any call |
Definition at line 205 of file GenericSAXHandler.cpp.
References GenericSAXHandler::buildErrorMessage().
Referenced by MSRouteHandler::addFlowPerson(), MSRouteHandler::closeContainer(), MSRouteHandler::closePerson(), MSRouteHandler::closePersonFlow(), NIImporter_OpenDrive::geomFromSpiral(), and MSRouteHandler::myStartElement().
|
inherited |
Handler for XML-errors.
The message is built using buildErrorMessage and thrown within a ProcessError.
ProcessError | On any call |
[in] | exception | The occurred exception to process |
Definition at line 211 of file GenericSAXHandler.cpp.
References GenericSAXHandler::buildErrorMessage().
|
inherited |
returns the current file name
Definition at line 74 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(), NITypeLoader::load(), PCNetProjectionLoader::load(), NLHandler::myEndElement(), RODFDetectorHandler::myStartElement(), GUISettingsHandler::myStartElement(), SUMORouteHandler::myStartElement(), NLHandler::myStartElement(), NIImporter_OpenDrive::myStartElement(), GNEAdditionalHandler::parseAndBuildPOI(), GNEAdditionalHandler::parseAndBuildPoly(), 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 863 of file NIImporter_SUMO.cpp.
References NIImporter_SUMO::EdgeAttrs::id, NBHelpers::interpretLaneID(), NIImporter_SUMO::EdgeAttrs::lanes, and WRITE_ERROR.
|
static |
begins the reading of a traffic lights logic
Definition at line 878 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, TIME2STEPS, SUMOXMLDefinitions::TrafficLightTypes, and WRITE_ERROR.
Referenced by myStartElement().
|
static |
Parses network location description and registers it with GeoConveHelper::setLoaded.
Definition at line 930 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 57 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 @exceptions ProcessError These method may throw a ProcessError if something fails |
Reimplemented in NIImporter_OpenDrive, and NIImporter_ITSUMO::Handler.
Definition at line 221 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 479 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, myCurrentJunction, myCurrentLane, myCurrentTL, myEdges, myLastParameterised, myTLLCont, NIImporter_SUMO::JunctionAttrs::node, SUMO_TAG_CONNECTION, SUMO_TAG_EDGE, SUMO_TAG_JUNCTION, 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 390 of file NIImporter_SUMO.cpp.
References addConnection(), addEdge(), addJunction(), addLane(), addPhase(), addProhibition(), addRequest(), addRoundabout(), addStopOffsets(), SUMOSAXAttributes::get(), SUMOSAXAttributes::getOpt(), SUMOSAXAttributes::getString(), SUMOSAXAttributes::hasAttribute(), initTrafficLightLogic(), loadLocation(), myAmLefthand, myCheckLaneFoesAll, myCheckLaneFoesRoundabout, myCornerDetail, myCurrentLane, myCurrentTL, myLastParameterised, myLimitTurnSpeed, myLinkDetail, myLocation, myNetworkVersion, myRectLaneCut, NIXMLTypesHandler::myStartElement(), myTypesHandler, myWalkingAreas, NIImporter_SUMO::LaneAttrs::oppositeID, SUMO_ATTR_CHECKLANEFOES_ALL, SUMO_ATTR_CORNERDETAIL, SUMO_ATTR_KEY, SUMO_ATTR_LANE, SUMO_ATTR_LEFTHAND, SUMO_ATTR_LIMIT_TURN_SPEED, SUMO_ATTR_LINKDETAIL, SUMO_ATTR_RECTANGULAR_LANE_CUT, SUMO_ATTR_VALUE, SUMO_ATTR_VERSION, SUMO_ATTR_WALKINGAREAS, SUMO_TAG_CONNECTION, SUMO_TAG_EDGE, SUMO_TAG_JUNCTION, SUMO_TAG_LANE, SUMO_TAG_LOCATION, SUMO_TAG_NEIGH, SUMO_TAG_NET, SUMO_TAG_PARAM, SUMO_TAG_PHASE, SUMO_TAG_PROHIBITION, SUMO_TAG_REQUEST, SUMO_TAG_ROUNDABOUT, SUMO_TAG_STOPOFFSET, 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 957 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 948 of file NIImporter_SUMO.cpp.
References SUMOSAXAttributes::get(), SUMOSAXAttributes::getOpt(), SUMO_ATTR_X, SUMO_ATTR_Y, and SUMO_ATTR_Z.
Referenced by addJunction().
|
inherited |
Assigning a parent handler which is enabled when the specified tag is closed.
Definition at line 161 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 68 of file GenericSAXHandler.cpp.
References GenericSAXHandler::myFileName.
Referenced by _loadNetwork(), GUISettingsHandler::GUISettingsHandler(), NITypeLoader::load(), PCNetProjectionLoader::load(), NIImporter_OpenStreetMap::load(), NIImporter_Vissim::load(), loadNet(), ROLoader::loadNet(), NIImporter_ITSUMO::loadNetwork(), NIImporter_MATSim::loadNetwork(), NIImporter_OpenDrive::loadNetwork(), main(), and XMLSubSys::runParser().
|
inlineprotectedinherited |
Definition at line 254 of file GenericSAXHandler.h.
References GenericSAXHandler::mySchemaSeen.
Referenced by SUMOSAXReader::LocalSchemaResolver::resolveEntity().
|
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 93 of file GenericSAXHandler.cpp.
References GenericSAXHandler::convertTag(), FileHelpers::getConfigurationRelative(), GenericSAXHandler::getFileName(), SUMOSAXAttributesImpl_Xerces::getString(), FileHelpers::isAbsolute(), GenericSAXHandler::myCharactersVector, GenericSAXHandler::myExpectedRoot, GenericSAXHandler::myPredefinedTags, GenericSAXHandler::myPredefinedTagsMML, GenericSAXHandler::mySchemaSeen, GenericSAXHandler::myStartElement(), XMLSubSys::runParser(), SUMO_ATTR_HREF, SUMO_TAG_INCLUDE, and StringUtils::transcode().
|
inherited |
Handler for XML-warnings.
The message is built using buildErrorMessage and reported to the warning-instance of the MsgHandler.
[in] | exception | The occurred exception to process |
Definition at line 199 of file GenericSAXHandler.cpp.
References GenericSAXHandler::buildErrorMessage(), and WRITE_WARNING.
|
private |
whether the loaded network was built for lefthand traffic
Definition at line 370 of file NIImporter_SUMO.h.
Referenced by _loadNetwork(), and myStartElement().
|
privateinherited |
A list of character strings obtained so far to build the complete characters string at the end.
Definition at line 306 of file GenericSAXHandler.h.
Referenced by GenericSAXHandler::characters(), GenericSAXHandler::endElement(), and GenericSAXHandler::startElement().
|
private |
whether foe-relationships where checked at lane-level
Definition at line 388 of file NIImporter_SUMO.h.
Referenced by _loadNetwork(), and myStartElement().
|
private |
Definition at line 389 of file NIImporter_SUMO.h.
Referenced by _loadNetwork(), and myStartElement().
|
private |
the level of corner detail in the loaded network
Definition at line 373 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 340 of file NIImporter_SUMO.h.
Referenced by addEdge(), addLane(), addStopOffsets(), and myEndElement().
|
private |
The currently parsed junction definition to help in reconstructing crossings.
Definition at line 343 of file NIImporter_SUMO.h.
Referenced by addJunction(), addRequest(), and myEndElement().
|
private |
The currently parsed lanes's definition (to add the shape to)
Definition at line 346 of file NIImporter_SUMO.h.
Referenced by addLane(), addStopOffsets(), myEndElement(), and myStartElement().
|
private |
The currently parsed traffic light.
Definition at line 349 of file NIImporter_SUMO.h.
Referenced by myEndElement(), and myStartElement().
|
private |
Loaded edge definitions.
Definition at line 322 of file NIImporter_SUMO.h.
Referenced by _loadNetwork(), addConnection(), myEndElement(), parseProhibitionConnection(), and ~NIImporter_SUMO().
|
privateinherited |
The root element to expect, empty string disables the check.
Definition at line 318 of file GenericSAXHandler.h.
Referenced by GenericSAXHandler::startElement().
|
privateinherited |
The name of the currently parsed file.
Definition at line 315 of file GenericSAXHandler.h.
Referenced by GenericSAXHandler::getFileName(), and GenericSAXHandler::setFileName().
|
private |
whether the loaded network contains internal lanes
Definition at line 367 of file NIImporter_SUMO.h.
Referenced by _loadNetwork(), and addEdge().
|
private |
element to receive parameters
Definition at line 361 of file NIImporter_SUMO.h.
Referenced by addConnection(), addEdge(), addJunction(), addLane(), myEndElement(), and myStartElement().
|
private |
whether turning speed was limited in the network
Definition at line 385 of file NIImporter_SUMO.h.
Referenced by _loadNetwork(), and myStartElement().
|
private |
the level of geometry detail for internal lanes in the loaded network
Definition at line 376 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 352 of file NIImporter_SUMO.h.
Referenced by addConnection(), addEdge(), addJunction(), addLane(), myStartElement(), and ~NIImporter_SUMO().
|
private |
The network builder to fill.
Definition at line 328 of file NIImporter_SUMO.h.
Referenced by _loadNetwork().
|
private |
the loaded network version
Definition at line 364 of file NIImporter_SUMO.h.
Referenced by _loadNetwork(), addConnection(), and myStartElement().
|
private |
The node container to fill.
Definition at line 331 of file NIImporter_SUMO.h.
Referenced by _loadNetwork(), and addJunction().
|
privateinherited |
The handler to give control back to.
Definition at line 309 of file GenericSAXHandler.h.
Referenced by GenericSAXHandler::endElement(), and GenericSAXHandler::registerParent().
|
privateinherited |
The tag indicating that control should be given back.
Definition at line 312 of file GenericSAXHandler.h.
Referenced by GenericSAXHandler::endElement(), and GenericSAXHandler::registerParent().
|
private |
The pedestrian crossings found in the network.
Definition at line 355 of file NIImporter_SUMO.h.
Referenced by _loadNetwork(), addConnection(), addEdge(), and addLane().
|
privateinherited |
Definition at line 288 of file GenericSAXHandler.h.
Referenced by GenericSAXHandler::GenericSAXHandler(), GenericSAXHandler::startElement(), and GenericSAXHandler::~GenericSAXHandler().
|
privateinherited |
the map from ids to their string representation
Definition at line 291 of file GenericSAXHandler.h.
Referenced by GenericSAXHandler::GenericSAXHandler(), SUMOSAXReader::parseNext(), and GenericSAXHandler::startElement().
|
private |
Loaded prohibitions.
Definition at line 325 of file NIImporter_SUMO.h.
Referenced by _loadNetwork(), and addProhibition().
|
private |
list of node id with rail signals (no NBTrafficLightDefinition exists)
Definition at line 395 of file NIImporter_SUMO.h.
Referenced by _loadNetwork(), and addJunction().
|
private |
whether all lanes of an edge should have the same stop line
Definition at line 379 of file NIImporter_SUMO.h.
Referenced by _loadNetwork(), and myStartElement().
|
private |
loaded roundabout edges
Definition at line 392 of file NIImporter_SUMO.h.
Referenced by _loadNetwork(), and addRoundabout().
|
privateinherited |
whether the reader has already seen a schema
Definition at line 321 of file GenericSAXHandler.h.
Referenced by GenericSAXHandler::setSchemaSeen(), and GenericSAXHandler::startElement().
|
privateinherited |
Definition at line 302 of file GenericSAXHandler.h.
Referenced by GenericSAXHandler::convertTag(), and GenericSAXHandler::GenericSAXHandler().
|
private |
The node container to fill.
Definition at line 334 of file NIImporter_SUMO.h.
Referenced by _loadNetwork(), and myEndElement().
|
private |
The handler for parsing edge types and restrictions.
Definition at line 337 of file NIImporter_SUMO.h.
Referenced by myStartElement().
|
private |
Map from walkingArea edge IDs to custom shapes.
Definition at line 358 of file NIImporter_SUMO.h.
Referenced by _loadNetwork(), addConnection(), and addLane().
|
private |
whether walkingareas must be built
Definition at line 382 of file NIImporter_SUMO.h.
Referenced by _loadNetwork(), and myStartElement().