57 #include <internal/HeightMapper.h>
60 #ifdef CHECK_MEMORY_LEAKS
62 #endif // CHECK_MEMORY_LEAKS
69 myEdgeCont(myTypeCont),
70 myHaveSeenRoundabouts(false)
80 if (oc.
isSet(
"keep-edges.input-file")) {
81 std::ifstream strm(oc.
getString(
"keep-edges.input-file").c_str());
83 throw ProcessError(
"Could not load names of edges too keep from '" + oc.
getString(
"keep-edges.input-file") +
"'.");
85 std::ostringstream oss;
96 oc.
set(
"keep-edges.explicit", oss.str());
109 const std::set<std::string>& explicitTurnarounds,
110 bool removeUnwishedNodes) {
121 if (oc.
exists(
"remove-edges.isolated") && oc.
getBool(
"remove-edges.isolated")) {
127 if (oc.
exists(
"keep-edges.postload") && oc.
getBool(
"keep-edges.postload")) {
128 if (oc.
isSet(
"keep-edges.explicit")) {
135 if (oc.
exists(
"junctions.join-exclude") && oc.
isSet(
"junctions.join-exclude")) {
139 if (oc.
getBool(
"junctions.join")) {
152 for (std::vector<EdgeVector>::const_iterator it_round =
myRoundabouts.begin();
154 std::vector<std::string> nodeIDs;
155 for (EdgeVector::const_iterator it_edge = it_round->begin(); it_edge != it_round->end(); ++it_edge) {
156 nodeIDs.push_back((*it_edge)->getToNode()->getID());
164 myEdgeCont.computeLaneShapes();
172 if (removeUnwishedNodes) {
174 const bool removeGeometryNodes = oc.
exists(
"geometry.remove") && oc.
getBool(
"geometry.remove");
175 PROGRESS_BEGIN_MESSAGE(
"Removing empty nodes" + std::string(removeGeometryNodes ?
" and geometry nodes" :
""));
186 if (oc.
exists(
"geometry.min-dist") && oc.
isSet(
"geometry.min-dist")) {
198 if (oc.
exists(
"geometry.split") && oc.
getBool(
"geometry.split")) {
214 if (oc.
exists(
"geometry.max-angle")) {
218 oc.
getBool(
"geometry.min-radius.fix"));
224 if (oc.
exists(
"speed.offset")) {
227 if (speedOffset != 0 || speedFactor != 1) {
230 (*i).second->setSpeed(-1, (*i).second->getSpeed() * speedFactor + speedOffset);
274 if (!oc.
getBool(
"no-turnarounds")) {
299 if (oc.
isSet(
"tls.set")) {
300 std::vector<std::string> tlControlledNodes = oc.
getStringVector(
"tls.set");
302 for (std::vector<std::string>::const_iterator i = tlControlledNodes.begin(); i != tlControlledNodes.end(); ++i) {
305 WRITE_WARNING(
"Building a tl-logic for node '" + *i +
"' is not possible." +
"\n The node '" + *i +
"' is not known.");
334 std::string progCount =
"";
335 if (numbers.first != numbers.second) {
336 progCount =
"(" +
toString(numbers.second) +
" programs) ";
340 if (oc.
isSet(
"street-sign-output")) {
347 if (!oc.
getBool(
"no-internal-links")) {
350 (*i).second->sortOutgoingConnectionsByIndex();
353 (*i).second->buildInnerEdges();
360 WRITE_MESSAGE(
"-----------------------------------------------------");
367 WRITE_MESSAGE(
"-----------------------------------------------------");
372 WRITE_WARNING(
"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");
383 boundary.
add(it->second->getPosition());
386 boundary.
add(it->second->getGeometry().getBoxBoundary());
392 (*i).second->reshiftPosition(x, y);
395 (*i).second->reshiftPosition(x, y);
398 (*i).second->reshiftPosition(x, y);
411 const HeightMapper& hm = HeightMapper::get();
430 if (maxLength > 0 && from.size() > 1) {
433 for (
int i = 0; i < (
int) from.size(); i++) {
439 for (
int i = 0; i < (
int)copy.size() - 1; i++) {
440 Position start = from[i + inserted];
441 Position end = from[i + inserted + 1];
442 SUMOReal length = copy[i].distanceTo(copy[i + 1]);
443 const Position step = (end - start) * (maxLength / length);
445 while (length > maxLength) {
448 from.
insertAt(i + inserted + 1, start + (step * steps));
456 for (
int i = 0; i < (
int) from.size(); i++) {