121 std::stringstream ss;
126 std::stringstream ss;
127 ss <<
"Duplicate definition of stopOffset for ";
131 ss <<
"edge " <<
myCurrentEdge->getID() <<
". Ignoring duplicate specification.";
134 std::stringstream ss;
135 ss <<
"Ignoring invalid stopOffset for ";
141 ss <<
" (offset larger than the edge length).";
143 ss <<
" (negative offset).";
280 myOptions.set(
"output.street-names",
"true");
384 WRITE_ERRORF(
"Additional lane information could not be set - the edge with id '%s' is not known.",
myCurrentID);
448 WRITE_ERRORF(
TL(
"Unable to project coordinates for lane '%'."), laneID);
450 if (shape.size() == 1) {
456 if (shape.size() < 2) {
473 WRITE_WARNING(
TL(
"Ignoring 'split' because it cannot be assigned to an edge"));
498 e.
lanes.push_back(lane);
505 if (e.
lanes.empty()) {
507 e.
lanes.push_back(l);
527 if (e.
node ==
nullptr) {
528 double geomPos = e.
pos;
552 const std::string begNodeID = attrs.
get<std::string>(
SUMO_ATTR_FROM,
nullptr, ok);
553 if (begNodeID !=
"") {
564 const std::string endNodeID = attrs.
get<std::string>(
SUMO_ATTR_TO,
nullptr, ok);
565 if (endNodeID !=
"") {
588 if (maxSegmentLength > 0) {
591 shape.push_back(
myToNode->getPosition());
613 std::string lsfS =
toString(result);
632 if (edge ==
nullptr) {
669 for (
int i = 0; i < (int)
myCurrentEdge->getLanes().size(); i++) {
700 const std::vector<std::string>& edgeIDs = attrs.
get<std::vector<std::string> >(
SUMO_ATTR_EDGES,
nullptr, ok);
703 for (
const std::string& eID : edgeIDs) {
705 if (edge ==
nullptr) {
710 roundabout.insert(edge);
#define WRITE_WARNINGF(...)
#define WRITE_MESSAGEF(...)
#define WRITE_ERRORF(...)
#define WRITE_WARNING(msg)
std::set< NBEdge * > EdgeSet
container for unique edges
const SVCPermissions SVC_UNSPECIFIED
permissions not specified
SVCPermissions parseVehicleClasses(const std::string &allowedS)
Parses the given definition of allowed vehicle classes into the given containers Deprecated classes g...
@ SUMO_TAG_STOPOFFSET
Information on vClass specific stop offsets at lane end.
@ SUMO_TAG_ROUNDABOUT
roundabout defined in junction
@ SUMO_TAG_VIEWSETTINGS_EDGES
@ SUMO_TAG_LANE
begin/end of the description of a single lane
@ SUMO_TAG_PARAM
parameter associated to a certain key
@ SUMO_TAG_NEIGH
begin/end of the description of a neighboring lane
@ SUMO_TAG_SPLIT
split something
@ SUMO_TAG_DEL
delete certain element (note: DELETE is a macro)
@ SUMO_TAG_EDGE
begin/end of the description of an edge
LaneSpreadFunction
Numbers representing special SUMO-XML-attribute values Information how the edge's lateral offset shal...
@ SUMO_ATTR_EDGES
the edges of a route
@ SUMO_ATTR_SHAPE
edge: the shape in xml-definition
@ SUMO_ATTR_SPREADTYPE
The information about how to spread the lanes from the given position.
@ SUMO_ATTR_BIKELANEWIDTH
@ SUMO_ATTR_SIDEWALKWIDTH
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
const std::string & getFileName() const
returns the current file name
static GeoConvHelper * getLoadedPlain(const std::string &plainFile, const std::string &suffix=".edg.xml")
A container for districts.
Storage for edges, including some functionality operating on multiple edges.
The representation of a single edge during network building.
static const double UNSPECIFIED_FRICTION
unspecified lane friction
static const double UNSPECIFIED_LOADED_LENGTH
no length override given
void deleteLane(int index, bool recompute, bool shiftIndices)
delete lane
static const double UNSPECIFIED_SPEED
unspecified lane speed
static const double UNSPECIFIED_WIDTH
unspecified lane width
static const double UNSPECIFIED_OFFSET
unspecified lane offset
static bool transformCoordinates(PositionVector &from, bool includeInBoundary=true, GeoConvHelper *from_srs=nullptr)
static int addGeometrySegments(PositionVector &from, const PositionVector &cartesian, const double maxLength)
insertion geometry points to ensure maximum segment length between points
Container for nodes during the netbuilding process.
Represents a single node (junction) during network building.
const Position & getPosition() const
A container for traffic light definitions and built programs.
A storage for available edgeTypes of edges.
static GeoConvHelper * loadLocation(const SUMOSAXAttributes &attrs, bool setLoaded=true)
Parses network location description and registers it with GeoConveHelper::setLoaded.
Finds a split at the given position.
std::string myCurrentID
The current edge's id.
SVCPermissions myPermissions
Information about lane permissions.
bool setNodes(const SUMOSAXAttributes &attrs)
Sets from/to node information of the currently parsed edge.
PositionVector myShape
The shape of the edge.
std::string myCurrentStreetName
The current edge's street name.
LaneSpreadFunction tryGetLaneSpread(const SUMOSAXAttributes &attrs)
Tries to parse the spread type.
double myCurrentSpeed
The current edge's maximum speed.
double myBikeLaneWidth
The width of the bike lane that shall be added to the current edge.
~NIXMLEdgesHandler()
Destructor.
int myCurrentLaneNo
The current edge's number of lanes.
GeoConvHelper * myLocation
The coordinate transformation which was used compute the node coordinates.
OptionsCont & myOptions
A reference to the program's options.
void addRoundabout(const SUMOSAXAttributes &attrs)
Parses a roundabout and stores it in myEdgeCont.
double myCurrentWidth
The current edge's lane width.
NIXMLEdgesHandler(NBNodeCont &nc, NBEdgeCont &ec, NBTypeCont &tc, NBDistrictCont &dc, NBTrafficLightLogicCont &tlc, OptionsCont &options)
Constructor.
NBTypeCont & myTypeCont
The types container (for retrieval of type defaults).
double myCurrentEndOffset
The current edge's offset till the destination node.
double myLength
The current edge's length.
int myCurrentPriority
The current edge's priority.
NBNodeCont & myNodeCont
The nodes container (for retrieval of referenced nodes).
PositionVector tryGetShape(const SUMOSAXAttributes &attrs)
Tries to parse the shape definition.
bool myIsUpdate
Whether this edge definition is an update of a previously inserted edge.
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
LaneSpreadFunction myLanesSpread
Information about how to spread the lanes.
NBDistrictCont & myDistrictCont
The districts container (needed if an edge must be split).
std::vector< Parameterised * > myLastParameterised
element to receive parameters
NBEdgeCont & myEdgeCont
The edges container (for insertion of build edges).
double mySidewalkWidth
The width of the sidewalk that shall be added to the current edge.
bool myHaveWarnedAboutDeprecatedLaneId
void addSplit(const SUMOSAXAttributes &attrs)
Parses a split and stores it in mySplits. Splits are executed Upon reading the end tag of an edge.
std::string myCurrentType
The current edge's type.
NBEdge * myCurrentEdge
The currently processed edge.
NBTrafficLightLogicCont & myTLLogicCont
The traffic lights container to add built tls to (when invalidating tls because of splits).
std::vector< NBEdgeCont::Split > mySplits
The list of this edge's splits.
double myCurrentFriction
The current edge's friction.
int myCurrentLaneIndex
The currently processed lane index.
bool myHaveReportedAboutTypeOverride
Information whether at least one edge's type was changed.
NBNode * myFromNode
The nodes the edge starts and ends at.
void addLane(const SUMOSAXAttributes &attrs)
Parses a lane and modifies myCurrentEdge according to the given attribures.
void myEndElement(int element)
Called when a closing tag occurs.
const bool myKeepEdgeShape
Whether the edge shape shall be kept generally.
bool myHaveReportedAboutOverwriting
Information whether at least one edge's attributes were overwritten.
void deleteEdge(const SUMOSAXAttributes &attrs)
parses delete tag and deletes the specified edge or lane
bool myReinitKeepEdgeShape
Whether the edge shape shall be kept at reinitilization.
void addEdge(const SUMOSAXAttributes &attrs)
Parses an edge and stores the values in "myCurrentEdge".
static NBNode * processNodeType(const SUMOSAXAttributes &attrs, NBNode *node, const std::string &nodeID, const Position &position, bool updateEdgeGeometries, NBNodeCont &nc, NBEdgeCont &ec, NBTrafficLightLogicCont &tlc, GeoConvHelper *from_srs=nullptr)
parses node attributes (not related to positioning)
const std::string & getID() const
Returns the id.
A storage for options typed value containers).
double getFloat(const std::string &name) const
Returns the double-value of the named option (only for Option_Float).
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool).
static OptionsCont & getOptions()
Retrieves the options.
void push_front(const Position &p)
insert in front a Position
void removeDoublePoints(double minDist=POSITION_EPS, bool assertLength=false, int beginOffset=0, int endOffset=0, bool resample=false)
Removes positions if too near.
Encapsulated SAX-Attributes.
virtual std::string getString(int id, bool *isPresent=nullptr) const =0
Returns the string-value of the named (by its enum-value) attribute.
T getOpt(int attr, const char *objectid, bool &ok, T defaultValue=T(), bool report=true) const
Tries to read given attribute assuming it is an int.
virtual std::string getStringSecure(int id, const std::string &def) const =0
Returns the string-value of the named (by its enum-value) attribute.
T get(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is an int.
virtual bool hasAttribute(int id) const =0
Returns the information whether the named (by its enum-value) attribute is within the current list.
SUMOSAXHandler(const std::string &file="", const std::string &expectedRoot="")
Constructor.
static StringBijection< LaneSpreadFunction > LaneSpreadFunctions
lane spread functions
bool isDefined() const
check if stopOffset was defined
double getOffset() const
get offset
static int toInt(const std::string &sData)
converts a string into the integer value described by it by calling the char-type converter,...
A structure which describes changes of lane number or speed along the road.
int offsetFactor
direction in which to apply the offset (used by netgenerate for lefthand networks)
double speed
The speed after this change.
double offset
lateral offset to edge geometry
std::string nameID
the default node id
std::string idBefore
The id for the edge before the split.
double pos
The position of this change.
std::vector< int > lanes
The lanes after this change.
std::string idAfter
The id for the edge after the split.
NBNode * node
The new node that is created for this split.
bool needsLaneType() const
whether any lane attributes deviate from the edge attributes
std::vector< LaneTypeDefinition > laneTypeDefinitions
vector with LaneTypeDefinitions
double speed
The maximal velocity on a lane in m/s.
double friction
The default friction on a lane.
SVCPermissions permissions
List of vehicle edgeTypes that are allowed on this lane.
std::set< SumoXMLAttr > attrs
The attributes which have been set.
double width
lane width [m]