|
@@ -186,6 +186,8 @@ void StatIdx::readFromFile(const std::string& path) {
|
186
|
186
|
addGroupToMeta(gid, osmid);
|
187
|
187
|
}
|
188
|
188
|
|
|
189
|
+ _numOSMMetaGroups = _metaGroups.size();
|
|
190
|
+
|
189
|
191
|
LOG(INFO) << "Done.";
|
190
|
192
|
|
191
|
193
|
LOG(INFO) << "Init groups";
|
|
@@ -201,6 +203,23 @@ void StatIdx::readFromFile(const std::string& path) {
|
201
|
203
|
LOG(INFO) << "Building indices...";
|
202
|
204
|
initIndex();
|
203
|
205
|
LOG(INFO) << "Done.";
|
|
206
|
+
|
|
207
|
+ LOG(INFO) << "Input Stats:";
|
|
208
|
+ LOG(INFO) << _numOSMStations << " OSM stations";
|
|
209
|
+ LOG(INFO) << _numOSMGroups << " OSM groups";
|
|
210
|
+ LOG(INFO) << _numOSMMetaGroups << " OSM meta groups";
|
|
211
|
+
|
|
212
|
+ LOG(INFO) << "Suggestion Stats:";
|
|
213
|
+ LOG(INFO) << _numOK << " objects OK";
|
|
214
|
+ LOG(INFO) << _numDL << " stations should be removed from their group (DL)";
|
|
215
|
+ LOG(INFO) << _numMV << " stations should be moved into another group (MV)";
|
|
216
|
+ LOG(INFO) << _numGR << " stations should be moved into a group (GR)";
|
|
217
|
+ LOG(INFO) << _numCR
|
|
218
|
+ << " stations should be moved into newly created groups (CR)";
|
|
219
|
+ LOG(INFO) << _numER << " tags were marked as erroneous (ER)";
|
|
220
|
+ LOG(INFO) << _numMG << " relations should be merged (MG)";
|
|
221
|
+ LOG(INFO) << _numNM << " objects should be outfitted with a name (NM)";
|
|
222
|
+ LOG(INFO) << _numTR << " station names are most likely track numbers";
|
204
|
223
|
}
|
205
|
224
|
|
206
|
225
|
// _____________________________________________________________________________
|
|
@@ -214,6 +233,7 @@ void StatIdx::addGroupToMeta(size_t gid, size_t metaId) {
|
214
|
233
|
void StatIdx::addStation(int64_t osmid, const util::geo::DLine& geom,
|
215
|
234
|
const util::geo::DLine& latLngs, size_t origGroup,
|
216
|
235
|
size_t group, const OsmAttrs& attrs) {
|
|
236
|
+ _numOSMStations++;
|
217
|
237
|
auto centroid = util::geo::centroid(latLngs);
|
218
|
238
|
_stations.emplace_back(Station{_stations.size(),
|
219
|
239
|
osmid,
|
|
@@ -232,6 +252,7 @@ void StatIdx::addStation(int64_t osmid, const util::geo::DLine& geom,
|
232
|
252
|
|
233
|
253
|
// _____________________________________________________________________________
|
234
|
254
|
void StatIdx::addGroup(size_t osmid, const OsmAttrs& attrs) {
|
|
255
|
+ if (osmid > 1) _numOSMGroups++;
|
235
|
256
|
Group g;
|
236
|
257
|
g.id = _groups.size();
|
237
|
258
|
g.osmid = osmid;
|
|
@@ -254,7 +275,6 @@ void StatIdx::initMetaGroups() {
|
254
|
275
|
mg.poly = hull(mp, 11);
|
255
|
276
|
assert(mg.poly.getOuter().size());
|
256
|
277
|
|
257
|
|
-
|
258
|
278
|
for (auto p : mg.poly.getOuter()) {
|
259
|
279
|
mg.llPoly.getOuter().push_back(
|
260
|
280
|
util::geo::webMercToLatLng<double>(p.getX(), p.getY()));
|
|
@@ -680,6 +700,8 @@ void StatIdx::initSuggestions() {
|
680
|
700
|
sug.type = 7;
|
681
|
701
|
_suggestions.push_back(sug);
|
682
|
702
|
group.suggestions.push_back(_suggestions.size() - 1);
|
|
703
|
+
|
|
704
|
+ if (group.osmid > 2) _numNM++;
|
683
|
705
|
}
|
684
|
706
|
|
685
|
707
|
Suggestion sug;
|
|
@@ -699,6 +721,8 @@ void StatIdx::initSuggestions() {
|
699
|
721
|
auto b = util::geo::centroid(
|
700
|
722
|
getMetaGroup(getGroup(group.mergeId)->metaGroupId)->poly);
|
701
|
723
|
sug.arrow = getGroupArrow(a, b);
|
|
724
|
+
|
|
725
|
+ _numMG++;
|
702
|
726
|
} else {
|
703
|
727
|
// merge two groups
|
704
|
728
|
sug.type = 9;
|
|
@@ -710,6 +734,8 @@ void StatIdx::initSuggestions() {
|
710
|
734
|
auto a = util::geo::centroid(group.poly);
|
711
|
735
|
auto b = util::geo::centroid(getGroup(group.mergeId)->poly);
|
712
|
736
|
sug.arrow = getGroupArrow(a, b);
|
|
737
|
+
|
|
738
|
+ _numMG++;
|
713
|
739
|
}
|
714
|
740
|
|
715
|
741
|
_suggestions.push_back(sug);
|
|
@@ -734,6 +760,9 @@ void StatIdx::initSuggestions() {
|
734
|
760
|
|
735
|
761
|
_suggestions.push_back(sug);
|
736
|
762
|
group.suggestions.push_back(_suggestions.size() - 1);
|
|
763
|
+
|
|
764
|
+ _numTR++;
|
|
765
|
+ _numER++;
|
737
|
766
|
} else if (otherGrp->osmid == group.osmid) {
|
738
|
767
|
if (suggested.count({attrErr.attr, 6})) continue;
|
739
|
768
|
// fix attributes
|
|
@@ -747,8 +776,12 @@ void StatIdx::initSuggestions() {
|
747
|
776
|
|
748
|
777
|
_suggestions.push_back(sug);
|
749
|
778
|
group.suggestions.push_back(_suggestions.size() - 1);
|
|
779
|
+
|
|
780
|
+ _numER++;
|
750
|
781
|
}
|
751
|
782
|
}
|
|
783
|
+
|
|
784
|
+ if (group.suggestions.size() + group.attrErrs.size() == 0) _numOK++;
|
752
|
785
|
}
|
753
|
786
|
|
754
|
787
|
// station suggestions
|
|
@@ -763,6 +796,8 @@ void StatIdx::initSuggestions() {
|
763
|
796
|
sug.type = 7;
|
764
|
797
|
_suggestions.push_back(sug);
|
765
|
798
|
stat.suggestions.push_back(_suggestions.size() - 1);
|
|
799
|
+
|
|
800
|
+ _numNM++;
|
766
|
801
|
}
|
767
|
802
|
|
768
|
803
|
Suggestion sug;
|
|
@@ -789,6 +824,9 @@ void StatIdx::initSuggestions() {
|
789
|
824
|
|
790
|
825
|
_suggestions.push_back(sug);
|
791
|
826
|
stat.suggestions.push_back(_suggestions.size() - 1);
|
|
827
|
+
|
|
828
|
+ _numTR++;
|
|
829
|
+ _numER++;
|
792
|
830
|
} else if (otherStat->osmid == stat.osmid) {
|
793
|
831
|
if (suggested.count({attrErr.attr, 6})) continue;
|
794
|
832
|
suggested.insert({attrErr.attr, 6});
|
|
@@ -802,6 +840,8 @@ void StatIdx::initSuggestions() {
|
802
|
840
|
|
803
|
841
|
_suggestions.push_back(sug);
|
804
|
842
|
stat.suggestions.push_back(_suggestions.size() - 1);
|
|
843
|
+
|
|
844
|
+ _numER++;
|
805
|
845
|
}
|
806
|
846
|
}
|
807
|
847
|
|
|
@@ -819,6 +859,7 @@ void StatIdx::initSuggestions() {
|
819
|
859
|
_suggestions.push_back(sug);
|
820
|
860
|
stat.suggestions.push_back(_suggestions.size() - 1);
|
821
|
861
|
|
|
862
|
+ _numCR++;
|
822
|
863
|
} else if (getGroup(stat.group)->osmid > 1) {
|
823
|
864
|
// move orphan into existing group
|
824
|
865
|
sug.type = 2;
|
|
@@ -830,6 +871,8 @@ void StatIdx::initSuggestions() {
|
830
|
871
|
|
831
|
872
|
_suggestions.push_back(sug);
|
832
|
873
|
stat.suggestions.push_back(_suggestions.size() - 1);
|
|
874
|
+
|
|
875
|
+ _numGR++;
|
833
|
876
|
}
|
834
|
877
|
} else {
|
835
|
878
|
if (getGroup(stat.group)->osmid == 1 &&
|
|
@@ -845,6 +888,8 @@ void StatIdx::initSuggestions() {
|
845
|
888
|
|
846
|
889
|
_suggestions.push_back(sug);
|
847
|
890
|
stat.suggestions.push_back(_suggestions.size() - 1);
|
|
891
|
+
|
|
892
|
+ _numCR++;
|
848
|
893
|
} else if (getGroup(stat.group)->osmid > 1) {
|
849
|
894
|
if (stat.group != getGroup(stat.origGroup)->mergeId) {
|
850
|
895
|
// move station from relation into existing group
|
|
@@ -852,9 +897,10 @@ void StatIdx::initSuggestions() {
|
852
|
897
|
sug.target_gid = stat.group;
|
853
|
898
|
sug.target_osm_rel_id = getGroup(stat.group)->osmid;
|
854
|
899
|
|
855
|
|
- // dont output arrow if move is part of a group merge
|
856
|
900
|
auto b = util::geo::centroid(getGroup(stat.group)->poly);
|
857
|
901
|
sug.arrow = getGroupArrow(centroid, b);
|
|
902
|
+
|
|
903
|
+ _numMV++;
|
858
|
904
|
} else {
|
859
|
905
|
continue;
|
860
|
906
|
// size_t metaId =
|
|
@@ -893,9 +939,13 @@ void StatIdx::initSuggestions() {
|
893
|
939
|
|
894
|
940
|
_suggestions.push_back(sug);
|
895
|
941
|
stat.suggestions.push_back(_suggestions.size() - 1);
|
|
942
|
+
|
|
943
|
+ _numDL++;
|
896
|
944
|
}
|
897
|
945
|
}
|
898
|
946
|
}
|
|
947
|
+
|
|
948
|
+ if (stat.suggestions.size() + stat.attrErrs.size() == 0) _numOK++;
|
899
|
949
|
}
|
900
|
950
|
}
|
901
|
951
|
|