Skip to content

Commit

Permalink
dont delete orphan edges anymore, might remove some candidates for ed…
Browse files Browse the repository at this point in the history
…ge snapping
  • Loading branch information
patrickbr committed Jan 24, 2024
1 parent 136fae1 commit 22bc04a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 31 deletions.
30 changes: 0 additions & 30 deletions src/pfaedle/osm/OsmBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,18 +137,12 @@ void OsmBuilder::read(const std::string& path, const OsmReadOpts& opts,
LOG(DEBUG) << "Snapping stations...";
snapStats(opts, g, bbox, gridSize, res, orphanStations);

LOG(DEBUG) << "Deleting orphan edges...";
deleteOrphEdgs(g, opts);

LOG(DEBUG) << "Collapsing edges...";
collapseEdges(g);

LOG(DEBUG) << "Writing edge geoms...";
writeGeoms(g, opts);

LOG(DEBUG) << "Deleting orphan edges...";
deleteOrphEdgs(g, opts);

LOG(DEBUG) << "Deleting orphan nodes...";
deleteOrphNds(g, opts);

Expand Down Expand Up @@ -1566,30 +1560,6 @@ void OsmBuilder::deleteOrphNds(Graph* g, const OsmReadOpts& opts) {
}
}

// _____________________________________________________________________________
void OsmBuilder::deleteOrphEdgs(Graph* g, const OsmReadOpts& opts) {
size_t ROUNDS = 3;
for (size_t c = 0; c < ROUNDS; c++) {
for (auto i = g->getNds().begin(); i != g->getNds().end();) {
if ((*i)->getInDeg() + (*i)->getOutDeg() != 1 || (*i)->pl().getSI() ||
(*i)->pl().isTurnCycle()) {
++i;
continue;
}

// check if the removal of this edge would transform a steep angle
// full turn at an intersection into a node 2 eligible for contraction
// if so, dont delete
if (keepFullTurn(*i, opts.fullTurnAngle)) {
++i;
continue;
}

i = g->delNd(*i);
}
}
}

// _____________________________________________________________________________
bool OsmBuilder::edgesSim(const Edge* a, const Edge* b) {
if (static_cast<bool>(a->pl().oneWay()) ^ static_cast<bool>(b->pl().oneWay()))
Expand Down
1 change: 0 additions & 1 deletion src/pfaedle/osm/OsmBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ class OsmBuilder {
double gridSize, Restrictor* res,
const NodeSet& orphanStations);
static void writeGeoms(Graph* g, const OsmReadOpts& opts);
static void deleteOrphEdgs(Graph* g, const OsmReadOpts& opts);
static void deleteOrphNds(Graph* g, const OsmReadOpts& opts);
static double dist(const Node* a, const Node* b);

Expand Down

0 comments on commit 22bc04a

Please sign in to comment.