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 removeElements) {
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 (removeElements) {
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" :
""));
185 boundary.
add(it->second->getPosition());
188 boundary.
add(it->second->getGeometry().getBoxBoundary());
197 if (oc.
exists(
"geometry.min-dist") && oc.
isSet(
"geometry.min-dist")) {
204 if (removeElements) {
211 if (oc.
exists(
"geometry.split") && oc.
getBool(
"geometry.split")) {
227 if (oc.
exists(
"geometry.max-angle")) {
231 oc.
getBool(
"geometry.min-radius.fix"));
237 if (oc.
exists(
"speed.offset")) {
240 if (speedOffset != 0 || speedFactor != 1) {
243 (*i).second->setSpeed(-1, (*i).second->getSpeed() * speedFactor + speedOffset);
287 if (!oc.
getBool(
"no-turnarounds")) {
312 if (oc.
isSet(
"tls.set")) {
313 std::vector<std::string> tlControlledNodes = oc.
getStringVector(
"tls.set");
315 for (std::vector<std::string>::const_iterator i = tlControlledNodes.begin(); i != tlControlledNodes.end(); ++i) {
318 WRITE_WARNING(
"Building a tl-logic for node '" + *i +
"' is not possible." +
"\n The node '" + *i +
"' is not known.");
347 std::string progCount =
"";
348 if (numbers.first != numbers.second) {
349 progCount =
"(" +
toString(numbers.second) +
" programs) ";
353 if (oc.
isSet(
"street-sign-output")) {
360 if (!oc.
getBool(
"no-internal-links")) {
363 (*i).second->sortOutgoingConnectionsByIndex();
366 (*i).second->buildInnerEdges();
373 WRITE_MESSAGE(
"-----------------------------------------------------");
380 WRITE_MESSAGE(
"-----------------------------------------------------");
385 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");
397 (*i).second->reshiftPosition(x, y);
400 (*i).second->reshiftPosition(x, y);
403 (*i).second->reshiftPosition(x, y);
416 const HeightMapper& hm = HeightMapper::get();
435 if (maxLength > 0 && from.size() > 1) {
438 for (
int i = 0; i < (
int) from.size(); i++) {
444 for (
int i = 0; i < (
int)copy.size() - 1; i++) {
445 Position start = from[i + inserted];
446 Position end = from[i + inserted + 1];
447 SUMOReal length = copy[i].distanceTo(copy[i + 1]);
448 const Position step = (end - start) * (maxLength / length);
450 while (length > maxLength) {
453 from.
insertAt(i + inserted + 1, start + (step * steps));
461 for (
int i = 0; i < (
int) from.size(); i++) {