|
@@ -297,14 +297,22 @@ void StatIdx::initGroups() {
|
297
|
297
|
_groups[_stations[i].origGroup].stations.push_back(i);
|
298
|
298
|
}
|
299
|
299
|
|
300
|
|
- if (_stations[i].group != _stations[i].origGroup &&
|
301
|
|
- _groups[_stations[i].group].osmid > 2 &&
|
|
300
|
+ // if all stations of a relation are moved into another same relation,
|
|
301
|
+ // suggest to merge the relation instead of suggesting each invidivual
|
|
302
|
+ // move
|
|
303
|
+ if (_groups[_stations[i].group].osmid > 2 &&
|
302
|
304
|
_groups[_stations[i].origGroup].osmid > 2) {
|
303
|
305
|
auto& orGr = _groups[_stations[i].origGroup];
|
304
|
|
- if (orGr.mergeId == 0)
|
|
306
|
+ if (orGr.mergeId == 0) {
|
|
307
|
+ // if no merge group has been yet written, set it to the target group
|
|
308
|
+ // of the currently check station
|
305
|
309
|
orGr.mergeId = _stations[i].group;
|
306
|
|
- else if (orGr.mergeId != _stations[i].group)
|
|
310
|
+ } else if (orGr.mergeId != _stations[i].group) {
|
|
311
|
+ // if a merge group was set, but the current station is not moved into
|
|
312
|
+ // this group, set the merge id to the group id. This is later inter-
|
|
313
|
+ // preted as DO NOT MERGE
|
307
|
314
|
orGr.mergeId = orGr.id;
|
|
315
|
+ }
|
308
|
316
|
}
|
309
|
317
|
|
310
|
318
|
assert(_stations[i].group < _groups.size());
|