47 while (angle2 > 180.) {
50 while (angle2 < -180.) {
59 double rel =
relAngle(angle1, angle2);
60 if (rel + NUMERICAL_EPS >= 180) {
70 std::stringstream strm1(
id);
73 std::stringstream strm2;
87 std::ifstream strm(file.c_str());
89 throw ProcessError(
TLF(
"Could not load names of edges too keep from '%'.", file));
97 into.insert(name.substr(5));
105 std::ifstream strm(file.c_str());
109 while (strm.good()) {
110 std::string prefixedID;
113 into.insert(prefixedID.substr(prefix.size()));
121 const std::string::size_type sep_index = lane_id.rfind(
'_');
122 if (sep_index == std::string::npos) {
125 edge_id = lane_id.substr(0, sep_index);
126 std::string index_string = lane_id.substr(sep_index + 1);
130 WRITE_ERRORF(
TL(
"Invalid lane index '%' for lane '%'."), index_string, lane_id);
#define WRITE_ERRORF(...)
static void loadPrefixedIDsFomFile(const std::string &file, const std::string prefix, std::set< std::string > &into)
Add prefixed ids defined in file.
static void interpretLaneID(const std::string &lane_id, std::string &edge_id, int &index)
parses edge-id and index from lane-id
static std::string normalIDRepresentation(const std::string &id)
converts the numerical id to its "normal" string representation
static double relAngle(double angle1, double angle2)
computes the relative angle between the two angles
static double normRelAngle(double angle1, double angle2)
ensure that reverse relAngles (>=179.999) always count as turnarounds (-180)
static double distance(NBNode *node1, NBNode *node2)
returns the distance between both nodes
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.
Represents a single node (junction) during network building.
const Position & getPosition() const
double distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimensions
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,...