56 myEdgeCont(myTypeCont),
57 myNetworkHaveCrossings(false) {
82 const bool lefthand = oc.
getBool(
"lefthand");
90 int numRemovedEdges = 0;
93 if (mayAddOrRemove && oc.
exists(
"remove-edges.isolated") && oc.
getBool(
"remove-edges.isolated")) {
98 if (mayAddOrRemove && oc.
exists(
"keep-edges.components") && oc.
getInt(
"keep-edges.components") > 0) {
100 const bool keepPTStops = oc.
isDefault(
"keep-edges.components.keep-ptstops")
101 ? (oc.
exists(
"ptstop-output") && oc.
isSet(
"ptstop-output"))
102 : oc.
getBool(
"keep-edges.components.keep-ptstops");
107 if (mayAddOrRemove && oc.
exists(
"keep-edges.postload") && oc.
getBool(
"keep-edges.postload")) {
114 if (oc.
isSet(
"keep-edges.explicit") || oc.
isSet(
"keep-edges.input-file")) {
121 numRemovedEdges += removed;
126 numRemovedEdges += removed2;
130 if (mayAddOrRemove && oc.
getFloat(
"keep-lanes.min-width") > 0.) {
133 numRemovedEdges += removed;
137 if (mayAddOrRemove && oc.
exists(
"junctions.attach-removed") && oc.
getFloat(
"junctions.attach-removed") >= 0) {
146 if (!(oc.
exists(
"ptline-output") && oc.
isSet(
"ptline-output"))
147 && !oc.
getBool(
"ptstop-output.no-bidi")) {
154 if (mayAddOrRemove && oc.
exists(
"keep-edges.components") && oc.
getInt(
"keep-edges.components") > 0) {
159 if (numRemovedEdges > 0) {
175 int numAddedBidi = 0;
176 if (oc.
exists(
"railway.topology.all-bidi") && oc.
getBool(
"railway.topology.all-bidi")) {
179 }
else if (oc.
exists(
"railway.topology.repair") && oc.
getBool(
"railway.topology.repair")) {
182 oc.
getFloat(
"geometry.min-radius"),
false,
183 oc.
getBool(
"geometry.min-radius.fix.railways"),
true);
188 if (numAddedBidi > 0) {
192 if (oc.
exists(
"railway.topology.direction-priority") && oc.
getBool(
"railway.topology.direction-priority")) {
195 }
else if (oc.
exists(
"railway.topology.extend-priority")
196 && (oc.
getBool(
"railway.topology.extend-priority") || oc.
getStringVector(
"railway.topology.ptline-priority").size() > 0)) {
198 if (oc.
getStringVector(
"railway.topology.ptline-priority").size() > 0) {
204 if (oc.
exists(
"railway.topology.output") && oc.
isSet(
"railway.topology.output")) {
208 if (oc.
exists(
"railway.geometry.straighten") && oc.
getBool(
"railway.geometry.straighten")) {
214 if (mayAddOrRemove && oc.
exists(
"edges.join-tram-dist") && oc.
getFloat(
"edges.join-tram-dist") >= 0) {
219 if (numJoinedTramEdges > 0) {
223 if (oc.
getBool(
"junctions.join")
225 || oc.
getBool(
"tls.guess.joining")
226 || (oc.
exists(
"tls.guess-signals") && oc.
getBool(
"tls.guess-signals"))) {
236 if (oc.
getBool(
"roundabouts.guess")) {
240 for (std::set<EdgeSet>::const_iterator it_round = roundabouts.begin();
241 it_round != roundabouts.end(); ++it_round) {
242 std::vector<std::string> nodeIDs;
243 for (EdgeSet::const_iterator it_edge = it_round->begin(); it_edge != it_round->end(); ++it_edge) {
244 nodeIDs.push_back((*it_edge)->getToNode()->getID());
254 if (mayAddOrRemove && oc.
exists(
"junctions.join-exclude") && oc.
isSet(
"junctions.join-exclude")) {
258 if (mayAddOrRemove && oc.
getBool(
"junctions.join")) {
266 if (mayAddOrRemove && oc.
getFloat(
"junctions.join-same") >= 0) {
270 if (numJoined2 > 0) {
275 if (mayAddOrRemove && oc.
exists(
"join-lanes") && oc.
getBool(
"join-lanes")) {
282 if (mayAddOrRemove) {
283 const bool removeGeometryNodes = oc.
exists(
"geometry.remove") && oc.
getBool(
"geometry.remove");
296 boundary.
add(it->second->getPosition());
299 boundary.
add(it->second->getGeometry().getBoxBoundary());
314 if (oc.
exists(
"geometry.min-dist") && !oc.
isDefault(
"geometry.min-dist")) {
321 if (mayAddOrRemove && oc.
getBool(
"edges.join")) {
323 const bool removeDuplicates = oc.
getFloat(
"junctions.join-same") >= 0;
326 if (oc.
exists(
"geometry.remove") && oc.
getBool(
"geometry.remove")) {
331 if (oc.
getBool(
"opposites.guess")) {
337 if (mayAddOrRemove && oc.
exists(
"geometry.split") && oc.
getBool(
"geometry.split")) {
342 if (oc.
getFloat(
"junctions.join-same") >= 0) {
344 if (numJoined3 > 0) {
354 if (oc.
exists(
"geometry.avoid-overlap") && oc.
getBool(
"geometry.avoid-overlap")) {
360 if (oc.
isSet(
"tls.set")) {
361 std::vector<std::string> tlControlledNodes = oc.
getStringVector(
"tls.set");
363 for (std::vector<std::string>::const_iterator i = tlControlledNodes.begin(); i != tlControlledNodes.end(); ++i) {
365 if (
node ==
nullptr) {
366 WRITE_WARNING(
"Building a tl-logic for junction '" + *i +
"' is not possible." +
"\n The junction '" + *i +
"' is not known.");
376 const bool modifyRamps = mayAddOrRemove && (
378 || (oc.
exists(
"ramps.set") && oc.
isSet(
"ramps.set")));
379 if (modifyRamps || (oc.
exists(
"ramps.guess-acceleration-lanes") && oc.
getBool(
"ramps.guess-acceleration-lanes"))) {
393 if (mayAddOrRemove && ((oc.
getBool(
"bikelanes.guess") || oc.
getBool(
"bikelanes.guess.from-permissions")))) {
395 oc.
getFloat(
"bikelanes.guess.min-speed"),
396 oc.
getFloat(
"bikelanes.guess.max-speed"),
397 oc.
getBool(
"bikelanes.guess.from-permissions"),
398 "bikelanes.guess.exclude",
404 if (mayAddOrRemove && ((oc.
getBool(
"sidewalks.guess") || oc.
getBool(
"sidewalks.guess.from-permissions")))) {
406 oc.
getFloat(
"sidewalks.guess.min-speed"),
407 oc.
getFloat(
"sidewalks.guess.max-speed"),
408 oc.
getBool(
"sidewalks.guess.from-permissions"),
409 "sidewalks.guess.exclude",
417 if (mayAddOrRemove) {
418 const bool numericalIDs = oc.
getBool(
"numerical-ids");
419 const bool reservedIDs = oc.
isSet(
"reserved-ids");
420 const bool keptIDs = oc.
isSet(
"kept-ids");
423 if (numChangedEdges + numChangedNodes > 0) {
429 if (oc.
exists(
"geometry.max-angle")) {
432 oc.
getBool(
"geometry.max-angle.fix"),
434 oc.
getBool(
"geometry.min-radius.fix"),
435 oc.
getBool(
"geometry.min-radius.fix.railways"));
446 if (oc.
exists(
"geometry.junction-mismatch-threshold")) {
461 if (oc.
exists(
"speed.offset")) {
462 const double speedOffset = oc.
getFloat(
"speed.offset");
463 const double speedFactor = oc.
getFloat(
"speed.factor");
464 const double speedMin = oc.
getFloat(
"speed.minimum");
465 if (speedOffset != 0 || speedFactor != 1 || speedMin > 0) {
468 NBEdge*
const e = it.second;
485 if (mayAddOrRemove && oc.
getBool(
"crossings.guess")) {
489 crossings += (*i).second->guessCrossings();
494 bool haveValidCrossings =
false;
497 if (i->second->getCrossings().size() > 0) {
499 haveValidCrossings =
true;
501 }
else if (i->second->getCrossingsIncludingInvalid().size() > 0) {
508 oc.
set(
"walkingareas",
"true");
515 oc.
set(
"no-internal-links",
"false");
527 if (oc.
getBool(
"roundabouts.guess")) {
530 if (numGuessed > 0) {
546 if (oc.
getBool(
"fringe.guess")) {
549 if (numGuessed > 0) {
556 if (!oc.
getBool(
"no-turnarounds")) {
558 oc.
getBool(
"no-turnarounds.tls"),
559 oc.
getBool(
"no-turnarounds.fringe"),
560 oc.
getBool(
"no-turnarounds.except-deadend"),
561 oc.
getBool(
"no-turnarounds.except-turnlane"),
562 oc.
getBool(
"no-turnarounds.geometry"));
566 if (oc.
exists(
"railway.topology.repair.stop-turn") && oc.
getBool(
"railway.topology.repair.stop-turn")
579 i->second->buildCrossingsAndWalkingAreas();
585 i->second->discardWalkingareas();
587 if (oc.
getBool(
"no-internal-links")) {
589 i->second->discardAllCrossings(
false);
604 if (oc.
exists(
"opendrive-files") && oc.
isSet(
"opendrive-files")) {
617 std::string progCount =
"";
618 if (numbers.first != numbers.second) {
619 progCount =
"(" +
toString(numbers.second) +
" programs) ";
622 if (oc.
exists(
"opendrive-files") && oc.
isSet(
"opendrive-files") && oc.
getBool(
"opendrive.signal-groups")) {
627 (*i).second->sortOutgoingConnectionsByIndex();
630 std::set<NBTrafficLightDefinition*> largeNodeTLS;
631 if (!oc.
getBool(
"no-internal-links")) {
636 const std::set<NBTrafficLightDefinition*>& tlDefs = item.second->getControllingTLS();
637 largeNodeTLS.insert(tlDefs.begin(), tlDefs.end());
643 if (oc.
getFloat(
"junctions.scurve-stretch") > 0) {
650 item.second->buildInnerEdges();
673 if (oc.
isSet(
"street-sign-output")) {
680 if (lefthand != oc.
getBool(
"flip-y-axis")) {
684 if (oc.
exists(
"geometry.check-overlap") && oc.
getFloat(
"geometry.check-overlap") > 0) {
701 int numBidiStops = 0;
702 if (!oc.
getBool(
"ptstop-output.no-bidi")) {
708 double maxRadius = oc.
getFloat(
"railway.access-distance");
709 double accessFactor = oc.
getFloat(
"railway.access-factor");
710 int maxCount = oc.
getInt(
"railway.max-accesses");
713 if (numBidiStops > 0) {
720 if (oc.
exists(
"ptline-clean-up") && oc.
getBool(
"ptline-clean-up")) {
727 if (numDeletedStops > 0) {
728 WRITE_WARNINGF(
TL(
"Removed % pt stops because they could not be assigned to the network"),
toString(numDeletedStops));
732 if (oc.
exists(
"ignore-change-restrictions") && !oc.
isDefault(
"ignore-change-restrictions")) {
741 WRITE_WARNING(
TL(
"Network contains very large coordinates and will probably flicker in the GUI. Check for outlying nodes and make sure the network is shifted to the coordinate origin"));
745 if (oc.
exists(
"osm-files") && oc.
isSet(
"osm-files")) {
757 const double x = -boundary.
xmin();
758 const double y = -(lefthand ? boundary.
ymax() : boundary.
ymin());
763 (*i).second->reshiftPosition(x, y);
766 (*i).second->reshiftPosition(x, y);
769 (*i).second->reshiftPosition(x, y);
772 stopIt.second->reshiftPosition(x, y);
783 item.second->roundSpeed();
788 (*i).second->roundGeometry();
791 (*i).second->roundGeometry();
800 (*i).second->mirrorX();
803 (*i).second->mirrorX();
806 (*i).second->mirrorX();
809 stopIt.second->mirrorX();
820 && from_srs !=
nullptr
846 const double eps = 1e-6;
847 from.
set(std::round(from.
x() / eps) * eps, std::round(from.
y() / eps) * eps, std::round(from.
z() / eps) * eps);
855 if (maxLength > 0 && from.size() > 1) {
858 for (
int i = 0; i < (int) from.size(); i++) {
864 for (
int i = 0; i < (int) from.size(); i++) {
876 for (
int i = 0; i < (int)cartesian.size() - 1; i++) {
877 Position start = from[i + inserted];
878 Position end = from[i + inserted + 1];
879 double length = cartesian[i].distanceTo(cartesian[i + 1]);
880 const Position step = (end - start) * (maxLength / length);
882 while (length > maxLength) {
885 from.insert(from.begin() + i + inserted + 1, start + (step * steps));
#define WRITE_WARNINGF(...)
#define WRITE_MESSAGEF(...)
#define WRITE_WARNING(msg)
#define PROGRESS_BEGIN_TIME_MESSAGE(msg)
#define PROGRESS_TIME_MESSAGE(before)
#define PROGRESS_DONE_MESSAGE()
#define PROGRESS_BEGIN_MESSAGE(msg)
SVCPermissions parseVehicleClasses(const std::string &allowedS)
Parses the given definition of allowed vehicle classes into the given containers Deprecated classes g...
long long int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
@ SVC_IGNORING
vehicles ignoring classes
@ SVC_BICYCLE
vehicle is a bicycle
@ SVC_PEDESTRIAN
pedestrian
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
A class that stores a 2D geometrical boundary.
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
double ymin() const
Returns minimum y-coordinate.
double xmin() const
Returns minimum x-coordinate.
double ymax() const
Returns maximum y-coordinate.
double xmax() const
Returns maximum x-coordinate.
double getZRange() const
Returns the elevation range of the boundary (z-axis)
static methods for processing the coordinates conversion for the current net
const Position getOffset() const
Returns the network offset.
void setConvBoundary(const Boundary &boundary)
sets the converted boundary
bool x2cartesian(Position &from, bool includeInBoundary=true)
Converts the given coordinate into a cartesian and optionally update myConvBoundary.
void cartesian2geo(Position &cartesian) const
Converts the given cartesian (shifted) position to its geo (lat/long) representation.
void moveConvertedBy(double x, double y)
Shifts the converted boundary by the given amounts.
static GeoConvHelper & getProcessing()
the coordinate transformation to use for input conversion and processing
static int getNumLoaded()
static void computeFinal(bool lefthand=false)
compute the location attributes which will be used for output based on the loaded location data,...
bool usingGeoProjection() const
Returns whether a transformation from geo to metric coordinates will be performed.
const Boundary & getConvBoundary() const
Returns the converted boundary.
static GeoConvHelper & getLoaded()
the coordinate transformation that was loaded fron an input file
std::map< std::string, NBDistrict * >::const_iterator end() const
Returns the pointer to the end of the stored districts.
std::map< std::string, NBDistrict * >::const_iterator begin() const
Returns the pointer to the begin of the stored districts.
void computeEdgeShapes(double smoothElevationThreshold=-1)
Computes the shapes of all edges stored in the container.
const std::set< EdgeSet > getRoundabouts() const
Returns the determined roundabouts.
void computeEdge2Edges(bool noLeftMovers)
Computes for each edge the approached edges.
int guessRoundabouts()
Determines which edges belong to roundabouts and increases their priority.
void sortOutgoingLanesConnections()
Sorts all lanes of all edges within the container by their direction.
void appendRailwayTurnarounds(const NBPTStopCont &sc)
Appends turnarounds to all bidiRail edges with stops.
std::map< std::string, NBEdge * >::const_iterator begin() const
Returns the pointer to the begin of the stored edges.
void updateAllChangeRestrictions(SVCPermissions ignoring)
modify all restrictions on lane changing for edges and connections
void recheckPostProcessConnections()
Try to set any stored connections.
void recheckLanes()
Rechecks whether all lanes have a successor for each of the stored edges.
void checkGeometries(const double maxAngle, bool fixAngle, const double minRadius, bool fix, bool fixRailways, bool silent=false)
void reduceGeometries(const double minDist)
void cleanupRoundabouts()
std::map< std::string, NBEdge * >::const_iterator end() const
Returns the pointer to the end of the stored edges.
void splitGeometry(NBDistrictCont &dc, NBNodeCont &nc)
Splits edges into multiple if they have a complex geometry.
void computeLanes2Edges()
Computes for each edge which lanes approach the next edges.
int getNumEdgeSplits() const
Returns the number of edge splits.
int joinTramEdges(NBDistrictCont &dc, NBPTStopCont &sc, NBPTLineCont &lc, double maxDist)
join tram edges into adjacent lanes
int removeUnwishedEdges(NBDistrictCont &dc)
Removes unwished edges (not in keep-edges)
void generateStreetSigns()
assigns street signs to edges based on toNode types
bool hasGuessedRoundabouts() const
check if there is guessed roundabouts
void computeAngles()
compute all edge angles
void guessOpposites()
Sets opposite lane information for geometrically close edges.
void markRoundabouts()
mark edge priorities and prohibit turn-arounds for all roundabout edges
void applyOptions(OptionsCont &oc)
Initialises the storage by applying given options.
int joinLanes(SVCPermissions perms)
join adjacent lanes with the given permissions
void checkOverlap(double threshold, double zThreshold) const
check whether edges overlap
int guessSpecialLanes(SUMOVehicleClass svc, double width, double minSpeed, double maxSpeed, bool fromPermissions, const std::string &excludeOpt, NBTrafficLightLogicCont &tlc)
add sidwalks to edges within the given limits or permissions and return the number of edges affected
void appendTurnarounds(bool noTLSControlled, bool noFringe, bool onlyDeadends, bool onlyTurnlane, bool noGeometryLike)
Appends turnarounds to all edges stored in the container.
void computeLaneShapes()
Computes the shapes of all lanes of all edges stored in the container.
void fixSplitCustomLength()
adapt custom lengths of split edges to account for intersection size
int removeLanesByWidth(NBDistrictCont &dc, const double minWidth)
int removeEdgesBySpeed(NBDistrictCont &dc)
return number of edges removed
int remapIDs(bool numericaIDs, bool reservedIDs, bool keptIDs, const std::string &prefix, NBPTStopCont &sc)
remap node IDs accoring to options –numerical-ids and –reserved-ids
void checkGrade(double threshold) const
check whether edges are to steep
int attachRemoved(NBNodeCont &nc, NBDistrictCont &dc, const double maxDist)
return number of edges split
int removeEdgesByPermissions(NBDistrictCont &dc)
The representation of a single edge during network building.
double getLaneSpeed(int lane) const
get lane speed
void setSpeed(int lane, double speed)
set lane specific speed (negative lane implies set for all lanes)
int getNumLanes() const
Returns the number of lanes.
static void setDefaultConnectionLength(double length)
static void computeEdgePriorities(NBNodeCont &nc)
Computes edge priorities within a node.
Set z-values for all network positions based on data from a height map.
double getZ(const Position &geo) const
returns height for the given geo coordinate (WGS84)
static const NBHeightMapper & get()
return the singleton instance (maybe 0)
bool ready() const
returns whether the NBHeightMapper has data
static bool transformCoordinates(PositionVector &from, bool includeInBoundary=true, GeoConvHelper *from_srs=nullptr)
void roundInputs()
ensure consistency between input and output geometries and speeds
void mirrorX()
mirror the network along the X-axis
NBNetBuilder()
Constructor.
NBTrafficLightLogicCont myTLLCont
The used container for traffic light logics.
void moveToOrigin(GeoConvHelper &geoConvHelper, bool lefthand)
shift network so its lower left corner is at 0,0
bool myNetworkHaveCrossings
flag to indicate that network has crossings
NBDistrictCont myDistrictCont
The used container for districts.
static int addGeometrySegments(PositionVector &from, const PositionVector &cartesian, const double maxLength)
insertion geometry points to ensure maximum segment length between points
NBPTLineCont myPTLineCont
The used container for pt stops.
NBEdgeCont myEdgeCont
The used container for edges.
NBParkingCont myParkingCont
~NBNetBuilder()
Destructor.
NBTypeCont myTypeCont
The used container for street types.
NBPTStopCont myPTStopCont
The used container for pt stops.
void applyOptions(OptionsCont &oc)
Initialises the storage by applying given options.
static bool transformCoordinate(Position &from, bool includeInBoundary=true, GeoConvHelper *from_srs=nullptr)
transforms loaded coordinates handles projections, offsets (using GeoConvHelper) and import of height...
void compute(OptionsCont &oc, const std::set< std::string > &explicitTurnarounds=std::set< std::string >(), bool mayAddOrRemove=true)
Performs the network building steps.
NBNodeCont myNodeCont
The used container for nodes.
static bool runningNetedit()
whether netbuilding takes place in the context of netedit
void avoidOverlap()
fix overlap
int removeRailComponents(NBDistrictCont &dc, NBEdgeCont &ec, NBPTStopCont &sc)
std::map< std::string, NBNode * >::const_iterator begin() const
Returns the pointer to the begin of the stored nodes.
void recheckGuessedTLS(NBTrafficLightLogicCont &tlc)
recheck myGuessedTLS after node logics are computed
void computeKeepClear()
compute keepClear status for all connections
int removeSelfLoops(NBDistrictCont &dc, NBEdgeCont &ec, NBTrafficLightLogicCont &tc)
Removes self-loop edges (edges where the source and the destination node are the same)
void addJoinExclusion(const std::vector< std::string > &ids)
int joinLoadedClusters(NBDistrictCont &dc, NBEdgeCont &ec, NBTrafficLightLogicCont &tlc)
Joins loaded junction clusters (see NIXMLNodesHandler)
int remapIDs(bool numericaIDs, bool reservedIDs, bool keptIDs, const std::string &prefix, NBTrafficLightLogicCont &tlc)
remap node IDs according to options –numerical-ids and –reserved-ids
NBNode * retrieve(const std::string &id) const
Returns the node with the given name.
void joinTLS(NBTrafficLightLogicCont &tlc, double maxdist)
Builds clusters of tls-controlled junctions and joins the control if possible.
int removeUnwishedNodes(NBDistrictCont &dc, NBEdgeCont &ec, NBTrafficLightLogicCont &tlc, NBPTStopCont &sc, NBPTLineCont &lc, NBParkingCont &pc, bool removeGeometryNodes)
Removes "unwished" nodes.
std::map< std::string, NBNode * >::const_iterator end() const
Returns the pointer to the end of the stored nodes.
int removeComponents(NBDistrictCont &dc, NBEdgeCont &ec, const int numKeep, bool hasPTStops)
Checks the network for weak connectivity and removes all but the largest components....
void computeLogics2(const NBEdgeCont &ec, OptionsCont &oc)
compute right-of-way logic for all lane-to-lane connections
void joinSimilarEdges(NBDistrictCont &dc, NBEdgeCont &ec, NBTrafficLightLogicCont &tlc, bool removeDuplicates)
Joins edges connecting the same nodes.
int removeIsolatedRoads(NBDistrictCont &dc, NBEdgeCont &ec)
Removes sequences of edges that are not connected with a junction. Simple roads without junctions som...
void setAsTLControlled(NBNode *node, NBTrafficLightLogicCont &tlc, TrafficLightType type, std::string id="")
Sets the given node as being controlled by a tls.
void computeLogics(const NBEdgeCont &ec)
build the list of outgoing edges and lanes
void computeNodeShapes(double mismatchThreshold=-1)
Compute the junction shape for this node.
void guessTLs(OptionsCont &oc, NBTrafficLightLogicCont &tlc)
Guesses which junctions or junction clusters shall be controlled by tls.
int joinSameJunctions(NBDistrictCont &dc, NBEdgeCont &ec, NBTrafficLightLogicCont &tlc, double maxDist)
Joins junctions with similar coordinates regardless of topology.
int guessFringe()
guess and mark fringe nodes
int joinJunctions(double maxDist, NBDistrictCont &dc, NBEdgeCont &ec, NBTrafficLightLogicCont &tlc, NBPTStopCont &sc)
Joins junctions that are very close together.
void computeLanes2Lanes()
divides the incoming lanes on outgoing lanes
bool resetNodeShapes()
reset all node shapes
Represents a single node (junction) during network building.
static void initRailSignalClasses(const NBNodeCont &nc)
initialize signalized rail classes
static void computeNodeTypes(NBNodeCont &nc, NBTrafficLightLogicCont &tlc)
Computes node types.
static void validateRailCrossings(NBNodeCont &nc, NBTrafficLightLogicCont &tlc)
Checks rail_crossing for validity.
static void sortNodesEdges(NBNodeCont &nc, bool useNodeShape=false)
Sorts a node's edges clockwise regarding driving direction.
void fixPermissions()
ensure that all turn lanes have sufficient permissions
void process(NBEdgeCont &ec, NBPTStopCont &sc, bool routeOnly=false)
std::set< std::string > getServedPTStops()
const std::map< std::string, NBPTLine * > & getLines() const
void removeInvalidEdges(const NBEdgeCont &ec)
filter out edges that were removed due to –geometry.remove
void fixBidiStops(const NBEdgeCont &ec)
select the correct stop on superposed rail edges
const std::map< std::string, std::shared_ptr< NBPTStop > > & getStops() const
Returns an unmodifiable reference to the stored pt stops.
int cleanupDeleted(NBEdgeCont &cont, bool reAssign=false)
remove stops on non existing (removed) edges
void postprocess(std::set< std::string > &usedStops)
void localizePTStops(NBEdgeCont &cont)
void assignEdgeForFloatingStops(NBEdgeCont &cont, double maxRadius)
void findAccessEdgesForRailStops(NBEdgeCont &cont, double maxRadius, int maxCount, double accessFactor)
int generateBidiStops(NBEdgeCont &cont)
duplicate stops for superposed rail edges and return the number of generated stops
void assignLanes(NBEdgeCont &cont)
int countBidiStops(NBEdgeCont &cont) const
count number of stop-pairs for superposed rail-edges
static int straigthenCorrdidor(NBEdgeCont &ec, double maxAngle)
static int guessRailSignals(NBNodeCont &nc, NBEdgeCont &ec, NBPTStopCont &sc, NBDistrictCont &dc)
static int repairTopology(NBEdgeCont &ec, NBPTStopCont &sc, NBPTLineCont &lc)
static void extendDirectionPriority(NBEdgeCont &ec, bool fromUniDir)
static void analyzeTopology(NBEdgeCont &ec)
static void setPTLinePriority(NBEdgeCont &ec, NBPTLineCont &lc, SVCPermissions vClasses)
static int makeAllBidi(NBEdgeCont &ec)
void computeRamps(NBNetBuilder &nb, OptionsCont &oc, bool mayAddOrRemove)
static void reportWarnings()
reports warnings if any occurred
The base class for traffic light logic definitions.
static const std::string OSM_DIRECTION
processing parameter for rail signal edges and nodes
static const int MIN_YELLOW_SECONDS
void applyOptions(OptionsCont &oc)
Initialises the storage by applying given options.
void setOpenDriveSignalParameters()
set OpenDRIVE signal reference parameters after all link indices are known
bool computeSingleLogic(OptionsCont &oc, NBTrafficLightDefinition *def)
Computes a specific traffic light logic (using by netedit)
void applyOpenDriveControllers(OptionsCont &oc)
post processing of signal programs to group tl indices according to OpenDrive controllers (signal gro...
std::pair< int, int > computeLogics(OptionsCont &oc)
Computes the traffic light logics using the stored definitions and stores the results.
void setTLControllingInformation(const NBEdgeCont &ec, const NBNodeCont &nc)
Informs the edges about being controlled by a tls.
static void computeTurnDirections(NBNodeCont &nc, bool warn=true)
Computes turnaround destinations for all edges (if exist)
void setEdgeTypeDefaults(int defaultNumLanes, double defaultLaneWidth, double defaultSpeed, double defaultFriction, int defaultPriority, SVCPermissions defaultPermissions, LaneSpreadFunction defaultSpreadType)
Sets the default values.
A storage for options typed value containers)
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
double getFloat(const std::string &name) const
Returns the double-value of the named option (only for Option_Float)
int getInt(const std::string &name) const
Returns the int-value of the named option (only for Option_Integer)
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
bool isDefault(const std::string &name) const
Returns the information whether the named option has still the default value.
bool exists(const std::string &name) const
Returns the information whether the named option is known.
bool set(const std::string &name, const std::string &value, const bool append=false)
Sets the given value for the named option.
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
const StringVector & getStringVector(const std::string &name) const
Returns the list of string-value of the named option (only for Option_StringVector)
void resetWritable()
Resets all options to be writeable.
static OptionsCont & getOptions()
Retrieves the options.
A point in 2D or 3D with translation and scaling methods.
void set(double x, double y)
set positions x and y
double x() const
Returns the x-position.
void setz(double z)
set position z
double z() const
Returns the z-position.
double y() const
Returns the y-position.
static StringBijection< LaneSpreadFunction > LaneSpreadFunctions
lane spread functions
static StringBijection< TrafficLightType > TrafficLightTypes
traffic light types
T get(const std::string &str) const
get key
static long getCurrentMillis()
Returns the current time in milliseconds.