void NIImporter_VISUM::parse_EdgePolys() { // get the from- & to-node and validate them NBNode* from = getNamedNode("VonKnot", "VonKnotNr"); NBNode* to = getNamedNode("NachKnot", "NachKnotNr"); if (!checkNodes(from, to)) { return; } bool failed = false; int index; SUMOReal x, y; try { index = TplConvert::_2int(myLineParser.get("INDEX").c_str()); x = getNamedFloat("XKoord"); y = getNamedFloat("YKoord"); } catch (NumberFormatException&) { WRITE_ERROR("Error in geometry description from node '" + from->getID() + "' to node '" + to->getID() + "'."); return; } Position pos(x, y); if (!NILoader::transformCoordinates(pos)) { WRITE_ERROR("Unable to project coordinates for node '" + from->getID() + "'."); return; } NBEdge* e = from->getConnectionTo(to); if (e != 0) { e->addGeometryPoint(index, pos); } else { failed = true; } e = to->getConnectionTo(from); if (e != 0) { e->addGeometryPoint(-index, pos); failed = false; } // check whether the operation has failed if (failed) { // we should report this to the warning instance only if we have removed // some nodes or edges... if (OptionsCont::getOptions().isSet("keep-edges.min-speed") || OptionsCont::getOptions().isSet("keep-edges.explicit")) { WRITE_WARNING("Could not set geometry between node '" + from->getID() + "' and node '" + to->getID() + "'."); } else { // ... in the other case we report this to the error instance if (OptionsCont::getOptions().getBool("visum.verbose-warnings")) { WRITE_WARNING("There is no edge from node '" + from->getID() + "' to node '" + to->getID() + "'."); } } } }