56 #ifdef CHECK_MEMORY_LEAKS
58 #endif // CHECK_MEMORY_LEAKS
74 if (!oc.
isSet(
"dlr-navteq-prefix")) {
80 std::map<std::string, PositionVector> myGeoms;
82 std::string file = oc.
getString(
"dlr-navteq-prefix") +
"_nodes_unsplitted.txt";
85 throw ProcessError(
"The file '" + file +
"' could not be opened.");
91 std::map<std::string, std::string> streetNames;
92 if (oc.
getBool(
"output.street-names")) {
93 file = oc.
getString(
"dlr-navteq-prefix") +
"_names.txt";
100 WRITE_WARNING(
"Output will not contain street names because the file '" + file +
"' was not found");
106 file = oc.
getString(
"dlr-navteq-prefix") +
"_links_unsplitted.txt";
110 throw ProcessError(
"The file '" + file +
"' could not be opened.");
117 file = oc.
getString(
"dlr-navteq-prefix") +
"_traffic_signals.txt";
131 const std::string& file,
132 std::map<std::string, PositionVector>& geoms)
133 : myNodeCont(nc), myGeoms(geoms) {
143 if (result[0] ==
'#') {
148 int no_geoms, intermediate;
150 std::istringstream stream(result);
154 throw ProcessError(
"Something is wrong with the following data line\n" + result);
157 stream >> intermediate;
159 if (myNodeCont.size() == 0) {
162 throw ProcessError(
"Non-numerical value for intermediate status in node " +
id +
".");
167 throw ProcessError(
"Non-numerical value for number of geometries in node " +
id +
".");
171 for (
int i = 0; i < no_geoms; i++) {
174 throw ProcessError(
"Non-numerical value for x-position in node " +
id +
".");
178 throw ProcessError(
"Non-numerical value for y-position in node " +
id +
".");
182 throw ProcessError(
"Unable to project coordinates for node " +
id +
".");
187 if (intermediate == 0) {
189 if (!myNodeCont.insert(n)) {
204 const std::string& file,
205 std::map<std::string, PositionVector>& geoms,
206 std::map<std::string, std::string>& streetNames):
207 myNodeCont(nc), myEdgeCont(ec), myGeoms(geoms), myStreetNames(streetNames) {
225 if (result[0] ==
'#') {
228 std::string id, fromID, toID, interID;
248 throw ProcessError(
"Non-numerical value for an edge's length occured (edge '" +
id +
"'.");
251 std::string veh_type = st.
next();
256 throw ProcessError(
"Non-numerical value for an edge's form_of_way occured (edge '" +
id +
"'.");
259 std::string brunnel_type = st.
next();
264 throw ProcessError(
"Non-numerical value for an edge's street_type occured (edge '" +
id +
"'.");
267 if (form_of_way == 11) {
269 }
else if (form_of_way > 11) {
276 std::string average_speed = st.
next();
278 std::string nameID_regional = st.
next();
280 std::string nameID_local = st.
next();
281 std::string streetName = getStreetNameFromIDs(nameID_regional, nameID_local);
282 std::vector<std::string> theRest = st.
getVector();
283 bool connection = (theRest.size() == 8) && (theRest[7] ==
"1");
284 if (theRest.size() > 8) {
286 if (theRest[8] !=
"-1") {
290 throw ProcessError(
"Non-numerical value for the extended number of lanes (edge '" +
id +
"'.");
293 connection = (theRest.size() == 10) && (theRest[9] ==
"1");
296 NBNode* from = myNodeCont.retrieve(fromID);
297 NBNode* to = myNodeCont.retrieve(toID);
299 throw ProcessError(
"The from-node '" + fromID +
"' of edge '" +
id +
"' could not be found");
302 throw ProcessError(
"The to-node '" + toID +
"' of edge '" +
id +
"' could not be found");
306 if (interID ==
"-1") {
307 e =
new NBEdge(
id, from, to,
"", speed, nolanes, priority,
316 e =
new NBEdge(
id, from, to,
"", speed, nolanes, priority,
322 if (form_of_way == 14) {
327 if (!myEdgeCont.insert(e)) {
337 const std::string& regionalID,
const std::string& localID)
const {
338 std::string result =
"";
339 bool hadRegional =
false;
340 if (myStreetNames.count(regionalID) > 0) {
342 result += myStreetNames[regionalID];
344 if (myStreetNames.count(localID) > 0) {
348 result += myStreetNames[localID];
359 const std::string& file) :
374 if (result[0] ==
'#') {
378 const std::string edgeID = st.
get(5);
379 NBEdge* edge = myEdgeCont.retrieve(edgeID);
381 WRITE_WARNING(
"The traffic light edge '" + edgeID +
"' could not be found");
390 if (!myTLLogicCont.insert(tlDef)) {
405 const std::string& file, std::map<std::string, std::string>& streetNames) :
406 myStreetNames(streetNames) {
417 if (result[0] ==
'#') {
421 if (st.
size() == 1) {
424 assert(st.
size() >= 2);
425 const std::string
id = st.
next();