dont delete orphan edges anymore, might remove some candidates for edge snapping

This commit is contained in:
Patrick Brosi 2024-01-24 14:06:54 +01:00
parent 136fae1cf1
commit 22bc04aa9d
2 changed files with 0 additions and 31 deletions

View file

@ -137,18 +137,12 @@ void OsmBuilder::read(const std::string& path, const OsmReadOpts& opts,
LOG(DEBUG) << "Snapping stations..."; LOG(DEBUG) << "Snapping stations...";
snapStats(opts, g, bbox, gridSize, res, orphanStations); snapStats(opts, g, bbox, gridSize, res, orphanStations);
LOG(DEBUG) << "Deleting orphan edges...";
deleteOrphEdgs(g, opts);
LOG(DEBUG) << "Collapsing edges..."; LOG(DEBUG) << "Collapsing edges...";
collapseEdges(g); collapseEdges(g);
LOG(DEBUG) << "Writing edge geoms..."; LOG(DEBUG) << "Writing edge geoms...";
writeGeoms(g, opts); writeGeoms(g, opts);
LOG(DEBUG) << "Deleting orphan edges...";
deleteOrphEdgs(g, opts);
LOG(DEBUG) << "Deleting orphan nodes..."; LOG(DEBUG) << "Deleting orphan nodes...";
deleteOrphNds(g, opts); deleteOrphNds(g, opts);
@ -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) { bool OsmBuilder::edgesSim(const Edge* a, const Edge* b) {
if (static_cast<bool>(a->pl().oneWay()) ^ static_cast<bool>(b->pl().oneWay())) if (static_cast<bool>(a->pl().oneWay()) ^ static_cast<bool>(b->pl().oneWay()))

View file

@ -180,7 +180,6 @@ class OsmBuilder {
double gridSize, Restrictor* res, double gridSize, Restrictor* res,
const NodeSet& orphanStations); const NodeSet& orphanStations);
static void writeGeoms(Graph* g, const OsmReadOpts& opts); 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 void deleteOrphNds(Graph* g, const OsmReadOpts& opts);
static double dist(const Node* a, const Node* b); static double dist(const Node* a, const Node* b);