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")) {
224 if (oc.
getBool(
"sidewalks.guess")) {
226 oc.
getFloat(
"sidewalks.guess.min-speed"),
227 oc.
getFloat(
"sidewalks.guess.max-speed"));
234 if (oc.
exists(
"geometry.max-angle")) {
238 oc.
getBool(
"geometry.min-radius.fix"));
253 if (oc.
exists(
"geometry.junction-mismatch-threshold")) {
265 if (oc.
exists(
"speed.offset")) {
268 if (speedOffset != 0 || speedFactor != 1) {
271 (*i).second->setSpeed(-1, (*i).second->getSpeed() * speedFactor + speedOffset);
283 bool buildCrossingsAndWalkingAreas =
false;
284 if (oc.
getBool(
"crossings.guess")) {
285 buildCrossingsAndWalkingAreas =
true;
288 crossings += (*i).second->guessCrossings();
292 if (!oc.
getBool(
"no-internal-links") && !buildCrossingsAndWalkingAreas) {
295 if (i->second->getCrossings().size() > 0) {
296 buildCrossingsAndWalkingAreas =
true;
326 if (!oc.
getBool(
"no-turnarounds")) {
340 if (oc.
isSet(
"tls.set")) {
341 std::vector<std::string> tlControlledNodes = oc.
getStringVector(
"tls.set");
343 for (std::vector<std::string>::const_iterator i = tlControlledNodes.begin(); i != tlControlledNodes.end(); ++i) {
346 WRITE_WARNING(
"Building a tl-logic for node '" + *i +
"' is not possible." +
"\n The node '" + *i +
"' is not known.");
375 std::string progCount =
"";
376 if (numbers.first != numbers.second) {
377 progCount =
"(" +
toString(numbers.second) +
" programs) ";
381 if (oc.
isSet(
"street-sign-output")) {
388 if (!oc.
getBool(
"no-internal-links")) {
391 (*i).second->sortOutgoingConnectionsByIndex();
395 (*i).second->buildInnerEdges(buildCrossingsAndWalkingAreas);
402 WRITE_MESSAGE(
"-----------------------------------------------------");
409 WRITE_MESSAGE(
"-----------------------------------------------------");
414 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");
426 (*i).second->reshiftPosition(x, y);
429 (*i).second->reshiftPosition(x, y);
432 (*i).second->reshiftPosition(x, y);
445 const HeightMapper& hm = HeightMapper::get();
464 if (maxLength > 0 && from.size() > 1) {
467 for (
int i = 0; i < (
int) from.size(); i++) {
473 for (
int i = 0; i < (
int)copy.size() - 1; i++) {
474 Position start = from[i + inserted];
475 Position end = from[i + inserted + 1];
476 SUMOReal length = copy[i].distanceTo(copy[i + 1]);
477 const Position step = (end - start) * (maxLength / length);
479 while (length > maxLength) {
482 from.
insertAt(i + inserted + 1, start + (step * steps));
490 for (
int i = 0; i < (
int) from.size(); i++) {