51 #ifdef CHECK_MEMORY_LEAKS
53 #endif // CHECK_MEMORY_LEAKS
117 if (!oc.
isSet(
"itsumo-files")) {
125 for (std::vector<std::string>::const_iterator file = files.begin(); file != files.end(); ++file) {
128 WRITE_ERROR(
"Could not open itsumo-file '" + *file +
"'.");
145 :
GenericSAXHandler(itsumoTags, ITSUMO_TAG_NOTHING, itsumoAttrs, ITSUMO_ATTR_NOTHING,
"itsumo - file"), myNetBuilder(toFill) {
173 myParameter[
"id"] = mc;
176 myParameter[
"name"] = mc;
179 myParameter[
"x"] = mc;
182 myParameter[
"y"] = mc;
186 myParameter[
"sectionID"] = mc;
190 myParameter[
"lanesetID"] = mc;
193 myParameter[
"pos"] = mc;
196 myParameter[
"from"] = mc;
199 myParameter[
"to"] = mc;
203 myParameter[
"laneID"] = mc;
206 myParameter[
"i"] = mc;
209 myParameter[
"v"] = mc;
221 for (std::vector<Section*>::iterator i = mySections.begin(); i != mySections.end(); ++i) {
222 for (std::vector<LaneSet*>::iterator j = (*i)->laneSets.begin(); j != (*i)->laneSets.end(); ++j) {
225 if (!myNetBuilder.getEdgeCont().insert(edge)) {
227 WRITE_ERROR(
"Could not add edge '" + ls->
id +
"'. Probably declared twice.");
237 std::string
id = myParameter[
"id"];
242 WRITE_ERROR(
"Unable to project coordinates for node '" +
id +
"'.");
245 if (!myNetBuilder.getNodeCont().insert(node)) {
247 WRITE_ERROR(
"Could not add node '" +
id +
"'. Probably declared twice.");
250 WRITE_ERROR(
"Not numeric position information for node '" + myParameter[
"id"] +
"'.");
252 WRITE_ERROR(
"Missing data in node '" + myParameter[
"id"] +
"'.");
257 mySections.push_back(
new Section(myParameter[
"sectionID"], myCurrentLaneSets));
258 myCurrentLaneSets.clear();
263 std::string
id = myParameter[
"lanesetID"];
265 std::string fromID = myParameter[
"from"];
266 std::string toID = myParameter[
"to"];
267 NBNode* from = myNetBuilder.getNodeCont().retrieve(fromID);
268 NBNode* to = myNetBuilder.getNodeCont().retrieve(toID);
269 if (from == 0 || to == 0) {
270 WRITE_ERROR(
"Missing node in laneset '" + myParameter[
"lanesetID"] +
"'.");
272 if (myLaneSets.find(
id) != myLaneSets.end()) {
273 WRITE_ERROR(
"Fond laneset-id '" +
id +
"' twice.");
276 for (std::vector<Lane>::iterator j = myCurrentLanes.begin(); j != myCurrentLanes.end(); ++j) {
279 vSum /= (
SUMOReal) myCurrentLanes.size();
282 myCurrentLaneSets.push_back(ls);
283 myCurrentLanes.clear();
287 WRITE_ERROR(
"Not numeric value in laneset '" + myParameter[
"lanesetID"] +
"'.");
289 WRITE_ERROR(
"Missing data in laneset '" + myParameter[
"lanesetID"] +
"'.");
295 std::string
id = myParameter[
"laneID"];
298 myCurrentLanes.push_back(
Lane(
id, (
unsigned int) i, v));
300 WRITE_ERROR(
"Not numeric value in lane '" + myParameter[
"laneID"] +
"'.");
302 WRITE_ERROR(
"Missing data in lane '" + myParameter[
"laneID"] +
"'.");