52 #ifdef CHECK_MEMORY_LEAKS
54 #endif // CHECK_MEMORY_LEAKS
118 if (!oc.
isSet(
"itsumo-files")) {
126 for (std::vector<std::string>::const_iterator file = files.begin(); file != files.end(); ++file) {
129 WRITE_ERROR(
"Could not open itsumo-file '" + *file +
"'.");
146 :
GenericSAXHandler(itsumoTags, ITSUMO_TAG_NOTHING, itsumoAttrs, ITSUMO_ATTR_NOTHING,
"itsumo - file"), myNetBuilder(toFill) {
174 myParameter[
"id"] = mc;
177 myParameter[
"name"] = mc;
180 myParameter[
"x"] = mc;
183 myParameter[
"y"] = mc;
187 myParameter[
"sectionID"] = mc;
191 myParameter[
"lanesetID"] = mc;
194 myParameter[
"pos"] = mc;
197 myParameter[
"from"] = mc;
200 myParameter[
"to"] = mc;
204 myParameter[
"laneID"] = mc;
207 myParameter[
"i"] = mc;
210 myParameter[
"v"] = mc;
222 for (std::vector<Section*>::iterator i = mySections.begin(); i != mySections.end(); ++i) {
223 for (std::vector<LaneSet*>::iterator j = (*i)->laneSets.begin(); j != (*i)->laneSets.end(); ++j) {
226 if (!myNetBuilder.getEdgeCont().insert(edge)) {
228 WRITE_ERROR(
"Could not add edge '" + ls->
id +
"'. Probably declared twice.");
238 std::string
id = myParameter[
"id"];
243 WRITE_ERROR(
"Unable to project coordinates for node '" +
id +
"'.");
246 if (!myNetBuilder.getNodeCont().insert(node)) {
248 WRITE_ERROR(
"Could not add node '" +
id +
"'. Probably declared twice.");
251 WRITE_ERROR(
"Not numeric position information for node '" + myParameter[
"id"] +
"'.");
253 WRITE_ERROR(
"Missing data in node '" + myParameter[
"id"] +
"'.");
258 mySections.push_back(
new Section(myParameter[
"sectionID"], myCurrentLaneSets));
259 myCurrentLaneSets.clear();
264 std::string
id = myParameter[
"lanesetID"];
266 std::string fromID = myParameter[
"from"];
267 std::string toID = myParameter[
"to"];
268 NBNode* from = myNetBuilder.getNodeCont().retrieve(fromID);
269 NBNode* to = myNetBuilder.getNodeCont().retrieve(toID);
270 if (from == 0 || to == 0) {
271 WRITE_ERROR(
"Missing node in laneset '" + myParameter[
"lanesetID"] +
"'.");
273 if (myLaneSets.find(
id) != myLaneSets.end()) {
274 WRITE_ERROR(
"Fond laneset-id '" +
id +
"' twice.");
277 for (std::vector<Lane>::iterator j = myCurrentLanes.begin(); j != myCurrentLanes.end(); ++j) {
280 vSum /= (
SUMOReal) myCurrentLanes.size();
283 myCurrentLaneSets.push_back(ls);
284 myCurrentLanes.clear();
288 WRITE_ERROR(
"Not numeric value in laneset '" + myParameter[
"lanesetID"] +
"'.");
290 WRITE_ERROR(
"Missing data in laneset '" + myParameter[
"lanesetID"] +
"'.");
296 std::string
id = myParameter[
"laneID"];
299 myCurrentLanes.push_back(
Lane(
id, (
unsigned int) i, v));
301 WRITE_ERROR(
"Not numeric value in lane '" + myParameter[
"laneID"] +
"'.");
303 WRITE_ERROR(
"Missing data in lane '" + myParameter[
"laneID"] +
"'.");