55 angle2 = (360 - angle2) * -1;
57 while (angle2 < -180) {
58 angle2 = 360 + angle2;
66 double rel =
relAngle(angle1, angle2);
77 std::stringstream strm1(
id);
80 std::stringstream strm2;
94 std::ifstream strm(file.c_str());
96 throw ProcessError(
"Could not load names of edges too keep from '" + file +
"'.");
104 into.insert(name.substr(5));
112 std::ifstream strm(file.c_str());
114 throw ProcessError(
"Could not load IDs from '" + file +
"'.");
116 while (strm.good()) {
117 std::string prefixedID;
120 into.insert(prefixedID.substr(prefix.size()));
static double relAngle(double angle1, double angle2)
computes the relative angle between the two angles
static void loadPrefixedIDsFomFile(const std::string &file, const std::string prefix, std::set< std::string > &into)
Add prefixed ids defined in file.
static double normRelAngle(double angle1, double angle2)
ensure that reverse relAngles (>=179.999) always count as turnarounds (-180)
static void loadEdgesFromFile(const std::string &file, std::set< std::string > &into)
Add edge ids defined in file (either ID or edge:ID per line) into the given set.
static std::string normalIDRepresentation(const std::string &id)
converts the numerical id to its "normal" string representation
static bool startsWith(const std::string &str, const std::string prefix)
Checks whether a given string starts with the prefix.
static double distance(NBNode *node1, NBNode *node2)
returns the distance between both nodes
const Position & getPosition() const
Represents a single node (junction) during network building.
double distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimension