49 while (angle2 > 180.) {
52 while (angle2 < -180.) {
61 double rel =
relAngle(angle1, angle2);
72 std::stringstream strm1(
id);
75 std::stringstream strm2;
89 std::ifstream strm(file.c_str());
91 throw ProcessError(
"Could not load names of edges too keep from '" + file +
"'.");
99 into.insert(name.substr(5));
107 std::ifstream strm(file.c_str());
109 throw ProcessError(
"Could not load IDs from '" + file +
"'.");
111 while (strm.good()) {
112 std::string prefixedID;
115 into.insert(prefixedID.substr(prefix.size()));
123 const std::string::size_type sep_index = lane_id.rfind(
'_');
124 if (sep_index == std::string::npos) {
125 WRITE_ERROR(
"Invalid lane id '" + lane_id +
"' (missing '_').");
127 edge_id = lane_id.substr(0, sep_index);
128 std::string index_string = lane_id.substr(sep_index + 1);
132 WRITE_ERROR(
"Invalid lane index '" + index_string +
"' for lane '" + lane_id +
"'.");
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 int toInt(const std::string &sData)
converts a string into the integer value described by it by calling the char-type converter...
static double distance(NBNode *node1, NBNode *node2)
returns the distance between both nodes
static void interpretLaneID(const std::string &lane_id, std::string &edge_id, int &index)
parses edge-id and index from lane-id
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