get rid of libboost dependency

This commit is contained in:
Patrick Brosi 2018-07-15 14:13:31 +02:00
parent 4674f0f116
commit d387314715
18 changed files with 282 additions and 104 deletions

View file

@ -118,8 +118,8 @@ double Collector::add(const Trip* t, const Shape* oldS, const Shape* newS,
gjout.flush();
fstr.close();
double fac = cos(2 * atan(exp((oldSegs.front().front().get<1>() +
oldSegs.back().back().get<1>()) /
double fac = cos(2 * atan(exp((oldSegs.front().front().getY() +
oldSegs.back().back().getY()) /
6378137.0)) -
1.5707965);
@ -401,7 +401,7 @@ std::pair<size_t, double> Collector::getDa(const std::vector<FLine>& a,
// euclidean distance on web mercator is in meters on equator,
// and proportional to cos(lat) in both y directions
double fac =
cos(2 * atan(exp((a.front().front().get<1>() + a.back().back().get<1>()) /
cos(2 * atan(exp((a.front().front().getY() + a.back().back().getY()) /
6378137.0)) -
1.5707965);

View file

@ -31,10 +31,10 @@ bool BBoxIdx::contains(const Point<float>& p) const {
// _____________________________________________________________________________
util::geo::Box<float> BBoxIdx::getFullWebMercBox() const {
return util::geo::FBox(
util::geo::latLngToWebMerc<float>(_root.box.min_corner().get<1>(),
_root.box.min_corner().get<0>()),
util::geo::latLngToWebMerc<float>(_root.box.max_corner().get<1>(),
_root.box.max_corner().get<0>()));
util::geo::latLngToWebMerc<float>(_root.box.getLowerLeft().getY(),
_root.box.getLowerLeft().getX()),
util::geo::latLngToWebMerc<float>(_root.box.getUpperRight().getY(),
_root.box.getUpperRight().getX()));
}
// _____________________________________________________________________________

View file

@ -991,7 +991,7 @@ double OsmBuilder::webMercDistFactor(const util::geo::FPoint& a) const {
// euclidean distance on web mercator is in meters on equator,
// and proportional to cos(lat) in both y directions
double lat = 2 * atan(exp(a.get<1>() / 6378137.0)) - 1.5707965;
double lat = 2 * atan(exp(a.getY() / 6378137.0)) - 1.5707965;
return cos(lat);
}

View file

@ -121,8 +121,8 @@ NDistHeur::NDistHeur(const RoutingOpts& rOpts,
size_t c = 0;
double x = 0, y = 0;
for (auto to : tos) {
x += to->pl().getGeom()->get<0>();
y += to->pl().getGeom()->get<1>();
x += to->pl().getGeom()->getX();
y += to->pl().getGeom()->getY();
c++;
}
@ -144,8 +144,8 @@ DistHeur::DistHeur(uint8_t minLvl, const RoutingOpts& rOpts,
size_t c = 0;
double x = 0, y = 0;
for (auto to : tos) {
x += to->getFrom()->pl().getGeom()->get<0>();
y += to->getFrom()->pl().getGeom()->get<1>();
x += to->getFrom()->pl().getGeom()->getX();
y += to->getFrom()->pl().getGeom()->getY();
c++;
}

View file

@ -313,8 +313,8 @@ ad::cppgtfs::gtfs::Shape* ShapeBuilder::getGtfsShape(
for (const auto& hop : shp.hops) {
const trgraph::Node* l = hop.start;
if (hop.edges.size() == 0) {
FPoint ll = webMercToLatLng<float>(hop.start->pl().getGeom()->get<0>(),
hop.start->pl().getGeom()->get<1>());
FPoint ll = webMercToLatLng<float>(hop.start->pl().getGeom()->getX(),
hop.start->pl().getGeom()->getY());
if (dist > -0.5)
dist += webMercMeterDist(last, *hop.start->pl().getGeom());
@ -324,7 +324,7 @@ ad::cppgtfs::gtfs::Shape* ShapeBuilder::getGtfsShape(
last = *hop.start->pl().getGeom();
if (dist - lastDist > 0.01) {
ret->addPoint(ShapePoint(ll.get<1>(), ll.get<0>(), dist, seq));
ret->addPoint(ShapePoint(ll.getY(), ll.getX(), dist, seq));
seq++;
lastDist = dist;
}
@ -333,9 +333,9 @@ ad::cppgtfs::gtfs::Shape* ShapeBuilder::getGtfsShape(
last = *hop.end->pl().getGeom();
if (dist - lastDist > 0.01) {
ll = webMercToLatLng<float>(hop.end->pl().getGeom()->get<0>(),
hop.end->pl().getGeom()->get<1>());
ret->addPoint(ShapePoint(ll.get<1>(), ll.get<0>(), dist, seq));
ll = webMercToLatLng<float>(hop.end->pl().getGeom()->getX(),
hop.end->pl().getGeom()->getY());
ret->addPoint(ShapePoint(ll.getY(), ll.getX(), dist, seq));
seq++;
lastDist = dist;
}
@ -351,8 +351,8 @@ ad::cppgtfs::gtfs::Shape* ShapeBuilder::getGtfsShape(
dist = 0;
last = cur;
if (dist - lastDist > 0.01) {
FPoint ll = webMercToLatLng<float>(cur.get<0>(), cur.get<1>());
ret->addPoint(ShapePoint(ll.get<1>(), ll.get<0>(), dist, seq));
FPoint ll = webMercToLatLng<float>(cur.getX(), cur.getY());
ret->addPoint(ShapePoint(ll.getY(), ll.getX(), dist, seq));
seq++;
lastDist = dist;
}
@ -366,8 +366,8 @@ ad::cppgtfs::gtfs::Shape* ShapeBuilder::getGtfsShape(
dist = 0;
last = cur;
if (dist - lastDist > 0.01) {
FPoint ll = webMercToLatLng<float>(cur.get<0>(), cur.get<1>());
ret->addPoint(ShapePoint(ll.get<1>(), ll.get<0>(), dist, seq));
FPoint ll = webMercToLatLng<float>(cur.getX(), cur.getY());
ret->addPoint(ShapePoint(ll.getY(), ll.getX(), dist, seq));
seq++;
lastDist = dist;
}