Skip to content

Commit

Permalink
now rejecting roundabouts by size. fix #14634
Browse files Browse the repository at this point in the history
  • Loading branch information
namdre committed Apr 2, 2024
1 parent 497bdaa commit 76926c5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/netbuild/NBEdgeCont.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1435,7 +1435,12 @@ NBEdgeCont::guessRoundabouts() {
std::cout << " formFactor=" << formFactor(loopEdges) << "\n";
}
#endif
if (formFactor(loopEdges) > 0.6) {
double loopLength = 0;
for (NBEdge* e : loopEdges) {
loopLength += e->getLoadedLength();
}
if (formFactor(loopEdges) > 0.6
&& loopLength < OptionsCont::getOptions().getFloat("roundabouts.guess.max-length")) {
// collected edges are marked in markRoundabouts
EdgeSet guessed(loopEdges.begin(), loopEdges.end());
if (loadedRoundaboutEdges.count(loopEdges.front()) != 0) {
Expand Down
4 changes: 4 additions & 0 deletions src/netbuild/NBFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,10 @@ NBFrame::fillOptions(OptionsCont& oc, bool forNetgen) {
oc.addSynonyme("roundabouts.guess", "guess-roundabouts", true);
oc.addDescription("roundabouts.guess", "Processing", TL("Enable roundabout-guessing"));

// The Putrajaya Roundabout (Malaysia) holds the Guinness record for the world’s largest roundabout with 3.4km.
oc.doRegister("roundabouts.guess.max-length", new Option_Float(3500));
oc.addDescription("roundabouts.guess.max-length", "Processing", TL("Structures with a circumference above FLOAT threshold are not classified as roundabout"));

oc.doRegister("roundabouts.visibility-distance", new Option_Float(9));
oc.addDescription("roundabouts.visibility-distance", "Processing", TL("Default visibility when approaching a roundabout"));

Expand Down

0 comments on commit 76926c5

Please sign in to comment.