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 if (!oc.
getBool(
"tls.discard-loaded")) {
118 file = oc.
getString(
"dlr-navteq-prefix") +
"_traffic_signals.txt";
133 const std::string& file,
134 std::map<std::string, PositionVector>& geoms)
135 : myNodeCont(nc), myGeoms(geoms) {
145 if (result[0] ==
'#') {
150 int no_geoms, intermediate;
152 std::istringstream stream(result);
156 throw ProcessError(
"Something is wrong with the following data line\n" + result);
159 stream >> intermediate;
161 if (myNodeCont.size() == 0) {
164 throw ProcessError(
"Non-numerical value for intermediate status in node " +
id +
".");
169 throw ProcessError(
"Non-numerical value for number of geometries in node " +
id +
".");
173 for (
int i = 0; i < no_geoms; i++) {
176 throw ProcessError(
"Non-numerical value for x-position in node " +
id +
".");
180 throw ProcessError(
"Non-numerical value for y-position in node " +
id +
".");
184 throw ProcessError(
"Unable to project coordinates for node " +
id +
".");
189 if (intermediate == 0) {
191 if (!myNodeCont.insert(n)) {
206 const std::string& file,
207 std::map<std::string, PositionVector>& geoms,
208 std::map<std::string, std::string>& streetNames):
209 myNodeCont(nc), myEdgeCont(ec), myGeoms(geoms), myStreetNames(streetNames) {
227 if (result[0] ==
'#') {
230 std::string id, fromID, toID, interID;
250 throw ProcessError(
"Non-numerical value for an edge's length occured (edge '" +
id +
"'.");
253 std::string veh_type = st.
next();
258 throw ProcessError(
"Non-numerical value for an edge's form_of_way occured (edge '" +
id +
"'.");
261 std::string brunnel_type = st.
next();
266 throw ProcessError(
"Non-numerical value for an edge's street_type occured (edge '" +
id +
"'.");
269 if (form_of_way == 11) {
271 }
else if (form_of_way > 11) {
278 std::string average_speed = st.
next();
280 std::string nameID_regional = st.
next();
282 std::string nameID_local = st.
next();
283 std::string streetName = getStreetNameFromIDs(nameID_regional, nameID_local);
284 std::vector<std::string> theRest = st.
getVector();
285 bool connection = (theRest.size() == 8) && (theRest[7] ==
"1");
286 if (theRest.size() > 8) {
288 if (theRest[8] !=
"-1") {
292 throw ProcessError(
"Non-numerical value for the extended number of lanes (edge '" +
id +
"'.");
295 connection = (theRest.size() == 10) && (theRest[9] ==
"1");
298 NBNode* from = myNodeCont.retrieve(fromID);
299 NBNode* to = myNodeCont.retrieve(toID);
301 throw ProcessError(
"The from-node '" + fromID +
"' of edge '" +
id +
"' could not be found");
304 throw ProcessError(
"The to-node '" + toID +
"' of edge '" +
id +
"' could not be found");
308 if (interID ==
"-1") {
309 e =
new NBEdge(
id, from, to,
"", speed, nolanes, priority,
318 e =
new NBEdge(
id, from, to,
"", speed, nolanes, priority,
324 if (form_of_way == 14) {
329 if (!myEdgeCont.insert(e)) {
339 const std::string& regionalID,
const std::string& localID)
const {
340 std::string result =
"";
341 bool hadRegional =
false;
342 if (myStreetNames.count(regionalID) > 0) {
344 result += myStreetNames[regionalID];
346 if (myStreetNames.count(localID) > 0) {
350 result += myStreetNames[localID];
361 const std::string& file) :
376 if (result[0] ==
'#') {
380 const std::string edgeID = st.
get(5);
381 NBEdge* edge = myEdgeCont.retrieve(edgeID);
383 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();