55 #ifdef CHECK_MEMORY_LEAKS
57 #endif // CHECK_MEMORY_LEAKS
69 if (!oc.
isSet(
"dlr-navteq-prefix")) {
75 std::map<std::string, PositionVector> myGeoms;
77 std::string file = oc.
getString(
"dlr-navteq-prefix") +
"_nodes_unsplitted.txt";
80 throw ProcessError(
"The file '" + file +
"' could not be opened.");
86 file = oc.
getString(
"dlr-navteq-prefix") +
"_traffic_signals.txt";
96 file = oc.
getString(
"dlr-navteq-prefix") +
"_links_unsplitted.txt";
100 throw ProcessError(
"The file '" + file +
"' could not be opened.");
112 const std::string& file,
113 std::map<std::string, PositionVector> &geoms)
114 : myNodeCont(nc), myGeoms(geoms) {
124 if (result[0] ==
'#') {
129 int no_geoms, intermediate;
131 std::istringstream stream(result);
135 throw ProcessError(
"Something is wrong with the following data line\n" + result);
138 stream >> intermediate;
140 if (myNodeCont.size() == 0) {
143 throw ProcessError(
"Non-numerical value for intermediate status in node " +
id +
".");
148 throw ProcessError(
"Non-numerical value for number of geometries in node " +
id +
".");
152 for (
int i = 0; i < no_geoms; i++) {
155 throw ProcessError(
"Non-numerical value for x-position in node " +
id +
".");
159 throw ProcessError(
"Non-numerical value for y-position in node " +
id +
".");
163 throw ProcessError(
"Unable to project coordinates for node " +
id +
".");
168 if (intermediate == 0) {
170 if (!myNodeCont.insert(n)) {
185 const std::string& file,
186 std::map < std::string,
188 : myNodeCont(nc), myEdgeCont(ec), myGeoms(geoms) {
206 if (result[0] ==
'#') {
209 std::string id, fromID, toID, interID;
228 throw ProcessError(
"Non-numerical value for an edge's length occured (edge '" +
id +
"'.");
231 std::string veh_type = st.
next();
233 std::string form_of_way = st.
next();
235 std::string brunnel_type = st.
next();
237 std::string street_type = st.
next();
241 std::vector<std::string> theRest = st.
getVector();
242 bool connection = (theRest.size() == 11) && (theRest[10] ==
"1");
243 if (theRest.size() > 11) {
245 if (theRest[11] !=
"-1") {
249 throw ProcessError(
"Non-numerical value for the extended number of lanes (edge '" +
id +
"'.");
252 connection = (theRest.size() == 13) && (theRest[12] ==
"1");
255 NBNode* from = myNodeCont.retrieve(fromID);
256 NBNode* to = myNodeCont.retrieve(toID);
258 throw ProcessError(
"The from-node '" + fromID +
"' of edge '" +
id +
"' could not be found");
261 throw ProcessError(
"The to-node '" + toID +
"' of edge '" +
id +
"' could not be found");
265 if (interID ==
"-1") {
266 e =
new NBEdge(
id, from, to,
"", speed, nolanes, priority, -1, -1);
273 e =
new NBEdge(
id, from, to,
"", speed, nolanes, priority, -1, -1, geoms,
"",
LANESPREAD_CENTER);
277 e =
new NBEdge(
id, from, to,
"", speed, nolanes, priority, -1, -1, geoms,
"",
LANESPREAD_CENTER);
283 if (!myEdgeCont.insert(e)) {
296 const std::string& file)
297 : myNodeCont(nc), myTLLogicCont(tlc) {
309 if (result[0] ==
'#') {
313 std::string nodeID = st.
getVector().back();
314 NBNode* node = myNodeCont.retrieve(nodeID);
316 WRITE_WARNING(
"The traffic light node '" + nodeID +
"' could not be found");
321 if (!myTLLogicCont.insert(tlDef)) {
324 throw ProcessError(
"Could not allocate tls for '" + nodeID +
"'.");