Patrick Brosi před 5 roky
rodič
revize
65f39d8ba6
1 změnil soubory, kde provedl 9 přidání a 9 odebrání
  1. 9 9
      src/osmfixer/index/StatIdx.cpp

+ 9 - 9
src/osmfixer/index/StatIdx.cpp

@@ -85,9 +85,6 @@ void StatIdx::readFromFile(const std::string& path) {
85 85
     rec >> conf;
86 86
     rec >> otherId;
87 87
 
88
-    std::cout << id << " " << attr << " " << otherAttr << " " << conf << " "
89
-              << otherId << std::endl;
90
-
91 88
     _stations[id].attrErrs.push_back({attr, otherAttr, conf, otherId});
92 89
   }
93 90
 
@@ -99,7 +96,6 @@ void StatIdx::readFromFile(const std::string& path) {
99 96
 // _____________________________________________________________________________
100 97
 void StatIdx::addStation(size_t osmid, double lat, double lng, size_t origGroup,
101 98
                          size_t group, const OsmAttrs& attrs) {
102
-  std::cout << "Record: " << osmid << " " << lat << " " << lng << std::endl;
103 99
   auto point = util::geo::latLngToWebMerc<double>(lat, lng);
104 100
 
105 101
   _stations.emplace_back(
@@ -111,7 +107,6 @@ void StatIdx::addStation(size_t osmid, double lat, double lng, size_t origGroup,
111 107
 
112 108
 // _____________________________________________________________________________
113 109
 void StatIdx::addGroup(size_t osmid, const OsmAttrs& attrs) {
114
-  std::cout << osmid << std::endl;
115 110
   Group g;
116 111
   g.id = _groups.size();
117 112
   g.osmid = osmid;
@@ -129,7 +124,6 @@ void StatIdx::initGroups() {
129 124
     assert(_stations[i].group < _groups.size());
130 125
     if (_stations[i].group != _stations[i].origGroup &&
131 126
         _groups[_stations[i].group].osmid == 1) {
132
-      std::cout << "MURR" << std::endl;
133 127
       // only add non-orig groups to polygons of new (non-osm) groups
134 128
       _groups[_stations[i].group].stations.push_back(i);
135 129
     }
@@ -311,10 +305,14 @@ util::geo::DLine StatIdx::getGroupArrow(size_t stat, size_t group) const {
311 305
   auto pl = util::geo::PolyLine<double>(a, b);
312 306
   auto bb = pl.getPointAtDist(fmax(pl.getLength() / 2, pl.getLength() - 20)).p;
313 307
 
308
+  if (util::geo::dist(a, bb) < 0.0001) {
309
+    bb = a;
310
+    bb.setX(bb.getX() + 10);
311
+  }
312
+
314 313
   int side = rand() % 2;
315 314
   if (!side) side = -1;
316 315
 
317
-
318 316
   auto rot1 = util::geo::rotate(util::geo::DLine{a, bb}, 45 * side, a);
319 317
   auto rot2 = util::geo::rotate(util::geo::DLine{a, bb}, -20 * side, bb);
320 318
 
@@ -324,11 +322,13 @@ util::geo::DLine StatIdx::getGroupArrow(size_t stat, size_t group) const {
324 322
       util::geo::intersection(util::geo::LineSegment<double>{rot1[0], rot1[1]},
325 323
                               util::geo::LineSegment<double>{rot2[0], rot2[1]});
326 324
 
327
-  auto line = util::geo::BezierCurve<double>(a, i, rot3[0], bb).render(1).getLine();
325
+  auto line =
326
+      util::geo::BezierCurve<double>(a, i, rot3[0], bb).render(1).getLine();
328 327
 
329 328
   // arrowhead
330 329
   auto pl2 = util::geo::PolyLine<double>(line);
331
-  util::geo::LineSegment<double> headSeg(pl2.getPointAtDist(pl2.getLength() - 5).p, line.back());
330
+  util::geo::LineSegment<double> headSeg(
331
+      pl2.getPointAtDist(pl2.getLength() - 5).p, line.back());
332 332
   auto arrHeadLeft = util::geo::rotate(headSeg, -45, line.back()).first;
333 333
   auto arrHeadRight = util::geo::rotate(headSeg, 45, line.back()).first;
334 334