28 #include <xercesc/sax/HandlerBase.hpp> 29 #include <xercesc/sax/AttributeList.hpp> 30 #include <xercesc/sax/SAXParseException.hpp> 31 #include <xercesc/sax/SAXException.hpp> 56 myCurrentLine(nullptr) {
115 const std::string
id = attrs.
get<std::string>(
SUMO_ATTR_ID,
"busStop", ok);
117 const std::string laneID = attrs.
get<std::string>(
SUMO_ATTR_LANE,
id.c_str(), ok);
124 if (edge ==
nullptr) {
125 WRITE_ERROR(
"Edge '" + edgeID +
"' for stop '" +
id +
"' not found");
129 WRITE_ERROR(
"Lane '" + laneID +
"' for stop '" +
id +
"' not found");
137 WRITE_ERROR(
"Could not add public transport stop '" +
id +
"' (already exists)");
145 throw InvalidArgument(
"Could not add access outside a stopping place.");
158 const std::string
id = attrs.
get<std::string>(
SUMO_ATTR_ID,
"ptLine", ok);
163 const std::string nightService = attrs.
getStringSecure(
"nightService",
"");
181 const std::string
id = attrs.
get<std::string>(
SUMO_ATTR_ID,
"ptLine", ok);
183 if (stop ==
nullptr) {
void addAccess(std::string laneID, double offset, double length)
void myEndElement(int element)
Called when a closing tag occurs.
void addAccess(const SUMOSAXAttributes &attrs)
Parses an stop access definition.
void addPTStop(const SUMOSAXAttributes &attrs)
Parses an public transport stop.
Position positionAtOffset2D(double pos, double lateralOffset=0) const
Returns the position at the given length.
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
The representation of a single edge during network building.
void addPTStop(NBPTStop *pStop)
The representation of a single pt stop.
SAX-handler base for SUMO-files.
NBPTStopCont & myStopCont
The stop container (for loading of stops)
virtual bool hasAttribute(int id) const =0
Returns the information whether the named (by its enum-value) attribute is within the current list...
NBPTLine * myCurrentLine
The currently processed line.
virtual std::string getString(int id) const =0
Returns the string-value of the named (by its enum-value) attribute.
void setMyNumOfStops(int numStops)
void insert(NBPTLine *pLine)
insert new line
std::vector< Parameterised * > myLastParameterised
element to receive parameters
double myCurrentCompletion
the completion level of the current line
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Encapsulated SAX-Attributes.
T get(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is an int.
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter ...
int getNumLanes() const
Returns the number of lanes.
A point in 2D or 3D with translation and scaling methods.
parameter associated to a certain key
NBPTLineCont & myLineCont
The line container (for loading of lines)
static int getLaneIndexFromLaneID(const std::string laneID)
Storage for edges, including some functionality operating on multiple edges.
~NIXMLPTHandler()
Destructor.
void addPTLine(const SUMOSAXAttributes &attrs)
Parses a public transport line.
SVCPermissions getPermissions(int lane=-1) const
get the union of allowed classes over all lanes or for a specific lane
NBPTStop * myCurrentStop
The currently processed stop.
const PositionVector & getGeometry() const
Returns the geometry of the edge.
void addPTLineStop(const SUMOSAXAttributes &attrs)
Parses an public transport stop reference within a line element.
T getOpt(int attr, const char *objectid, bool &ok, T defaultValue, bool report=true) const
Tries to read given attribute assuming it is an int.
A train stop (alias for bus stop)
NBEdge * retrieve(const std::string &id, bool retrieveExtracted=false) const
Returns the edge that has the given id.
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
virtual std::string getStringSecure(int id, const std::string &def) const =0
Returns the string-value of the named (by its enum-value) attribute.
NBPTStop * get(std::string id)
Retrieve a previously inserted pt stop.
std::vector< NBPTStop * > getStops()
bool insert(NBPTStop *ptStop)
Inserts a node into the map.
NBEdgeCont & myEdgeCont
The edges container (for retrieving referenced stop edge)
long long int getLineID() const
static std::string getEdgeIDFromLane(const std::string laneID)
return edge id when given the lane ID
An access point for a train stop.
NIXMLPTHandler(NBEdgeCont &ec, NBPTStopCont &sc, NBPTLineCont &lc)
Constructor.