NIImporter_DlrNavteq Class Reference

#include <NIImporter_DlrNavteq.h>


Detailed Description

Importer for networks stored in Elmar's format.

Definition at line 58 of file NIImporter_DlrNavteq.h.


Static Public Member Functions

static void loadNetwork (const OptionsCont &oc, NBNetBuilder &nb)
 Loads content of the optionally given dlr-navteq (aka Elmar-fomat) folder.

Data Structures

class  EdgesHandler
 Importer of edges stored in unsplit elmar format. More...
class  NodesHandler
 Importer of nodes stored in unsplit elmar format. More...
class  TrafficlightsHandler
 Importer of traffic lights stored in DLRNavteq's (aka elmar) format. More...

Member Function Documentation

void NIImporter_DlrNavteq::loadNetwork ( const OptionsCont oc,
NBNetBuilder nb 
) [static]

Loads content of the optionally given dlr-navteq (aka Elmar-fomat) folder.

If the option "dlr-navteq" is set, the file(s) stored therein is read and the network definition stored therein is stored within the given network builder.

If the option "dlr-navteq" is not set, this method simply returns.

Parameters:
[in] oc The options to use
[in] nb The network builder to fill

Definition at line 63 of file NIImporter_DlrNavteq.cpp.

References MsgHandler::beginProcessMsg(), MsgHandler::endProcessMsg(), NBNetBuilder::getEdgeCont(), MsgHandler::getMessageInstance(), NBNetBuilder::getNodeCont(), OptionsCont::getString(), NBNetBuilder::getTLLogicCont(), OptionsCont::isSet(), LineReader::readAll(), NBEdgeCont::recheckLaneSpread(), and LineReader::setFile().

Referenced by NILoader::load().

00063                                                                          {
00064     // check whether the option is set (properly)
00065     if (!oc.isSet("dlr-navteq")) {
00066         return;
00067     }
00068     // parse file(s)
00069     LineReader lr;
00070     // load nodes
00071     std::map<std::string, Position2DVector> myGeoms;
00072     MsgHandler::getMessageInstance()->beginProcessMsg("Loading nodes...");
00073     std::string file = oc.getString("dlr-navteq") + "_nodes_unsplitted.txt";
00074     NodesHandler handler1(nb.getNodeCont(), file, myGeoms);
00075     if (!lr.setFile(file)) {
00076         throw ProcessError("The file '" + file + "' could not be opened.");
00077     }
00078     lr.readAll(handler1);
00079     MsgHandler::getMessageInstance()->endProcessMsg("done.");
00080 
00081     // load traffic lights
00082     file = oc.getString("dlr-navteq") + "_traffic_signals.txt";
00083     if (lr.setFile(file)) {
00084         MsgHandler::getMessageInstance()->beginProcessMsg("Loading traffic lights...");
00085         TrafficlightsHandler handler3(nb.getNodeCont(), nb.getTLLogicCont(), file);
00086         lr.readAll(handler3);
00087         MsgHandler::getMessageInstance()->endProcessMsg("done.");
00088     }
00089 
00090     // load edges
00091     MsgHandler::getMessageInstance()->beginProcessMsg("Loading edges...");
00092     file = oc.getString("dlr-navteq") + "_links_unsplitted.txt";
00093     // parse the file
00094     EdgesHandler handler2(nb.getNodeCont(), nb.getEdgeCont(), file, myGeoms);
00095     if (!lr.setFile(file)) {
00096         throw ProcessError("The file '" + file + "' could not be opened.");
00097     }
00098     lr.readAll(handler2);
00099     nb.getEdgeCont().recheckLaneSpread();
00100     MsgHandler::getMessageInstance()->endProcessMsg("done.");
00101 }


The documentation for this class was generated from the following files:

Generated on Wed May 5 00:06:52 2010 for Sumo - Simulation of Urban MObility by  doxygen 1.5.6