clean up and refactor half-baked development commits and squash them into a new version.

Changes:

* support for multiple GTFS feeds as input in filtering, read default global and local configuration files
* be a bit more memory conservative
* make caching optional
* dont delete orphan edge if it would transform a degree 3 node with a possible full turn into a degree 2 node eligible for contraction
* dedicated filters for funicular and gondola
* make max snap level option more intuitive
* allow filter rules for level 0
* additional fallback for station snapping
* dont try to route for MOT unequal to trip in -T mode, force-snap to orphaned OSM station if not snap was possible
* write bounds to filtered osm
* remove unused surrounding heuristic
* use bus lanes info
* be a bit more tolerant for bus oneway streets
* create missing directories
* error if no cfg is present, clean up evaluation Makefile
This commit is contained in:
Patrick Brosi 2019-01-10 16:52:59 +01:00
parent 2cc2d2dc23
commit 63f0b61ea1
60 changed files with 4532 additions and 1576 deletions

View file

@ -47,7 +47,7 @@ typedef Polygon<double> DPolygon;
typedef Polygon<float> FPolygon;
typedef Polygon<int> IPolygon;
const static double EPSILON = 0.00000000001;
const static double EPSILON = 0.00001;
const static double RAD = 0.017453292519943295; // PI/180
// _____________________________________________________________________________
@ -236,7 +236,7 @@ inline RotatedBox<T> shrink(const RotatedBox<T>& b, double d) {
}
// _____________________________________________________________________________
inline bool doubleEq(double a, double b) { return fabs(a - b) < 0.000001; }
inline bool doubleEq(double a, double b) { return fabs(a - b) < EPSILON; }
// _____________________________________________________________________________
template <typename T>
@ -404,7 +404,7 @@ inline bool intersects(const LineSegment<T>& ls1, const LineSegment<T>& ls2) {
// intersecting
return intersects(getBoundingBox(ls1), getBoundingBox(ls2)) &&
(((contains(ls1.first, ls2) ^ contains(ls1.second, ls2)) ^
(contains(ls2.first, ls1) ^ contains(ls2.second, ls1))) ||
(contains(ls2.first, ls1) ^ contains(ls2.second, ls1))) ||
(((crossProd(ls1.first, ls2) < 0) ^
(crossProd(ls1.second, ls2) < 0)) &&
((crossProd(ls2.first, ls1) < 0) ^
@ -1153,7 +1153,7 @@ inline size_t convexHullImpl(const MultiPoint<T>& a, size_t p1, size_t p2,
for (const auto& p : a) {
double tmpDist = distToSegment((*h)[p1], (*h)[p2], p);
double cp = crossProd(p, LineSegment<T>((*h)[p1], (*h)[p2]));
if (((cp > 0 && !d) || (cp < 0 && d)) && tmpDist > maxDist) {
if (((cp > 0 && !d) || (cp < 0 && d)) && tmpDist >= maxDist + EPSILON) {
pa = p;
found = true;
maxDist = tmpDist;
@ -1462,7 +1462,8 @@ inline Point<T> latLngToWebMerc(double lat, double lng) {
// _____________________________________________________________________________
template <typename T>
inline Point<T> webMercToLatLng(double x, double y) {
double lat = 114.591559026 * (atan(exp(y / 6378137.0)) - 0.78539825);
double lat =
(1.5707963267948966 - (2.0 * atan(exp(-y / 6378137.0)))) * (180.0 / M_PI);
double lon = x / 111319.4907932735677;
return Point<T>(lon, lat);
}

View file

@ -5,6 +5,8 @@
#ifndef UTIL_GEO_POINT_H_
#define UTIL_GEO_POINT_H_
#include <vector>
namespace util {
namespace geo {