SUMO - Simulation of Urban MObility
NIImporter_ArcView.h
Go to the documentation of this file.
00001 /****************************************************************************/
00008 // Importer for networks stored in ArcView-shape format
00009 /****************************************************************************/
00010 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
00011 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors
00012 /****************************************************************************/
00013 //
00014 //   This file is part of SUMO.
00015 //   SUMO is free software: you can redistribute it and/or modify
00016 //   it under the terms of the GNU General Public License as published by
00017 //   the Free Software Foundation, either version 3 of the License, or
00018 //   (at your option) any later version.
00019 //
00020 /****************************************************************************/
00021 #ifndef NIImporter_ArcView_h
00022 #define NIImporter_ArcView_h
00023 
00024 
00025 // ===========================================================================
00026 // included modules
00027 // ===========================================================================
00028 #ifdef _MSC_VER
00029 #include <windows_config.h>
00030 #else
00031 #include <config.h>
00032 #endif
00033 
00034 #include <string>
00035 
00036 
00037 // ===========================================================================
00038 // class declarations
00039 // ===========================================================================
00040 class OptionsCont;
00041 class OGRFeature;
00042 
00043 
00044 // ===========================================================================
00045 // class definitions
00046 // ===========================================================================
00056 class NIImporter_ArcView {
00057 public:
00069     static void loadNetwork(const OptionsCont& oc, NBNetBuilder& nb);
00070 
00071 
00072 protected:
00082     NIImporter_ArcView(const OptionsCont& oc,
00083                        NBNodeCont& nc, NBEdgeCont& ec, NBTypeCont& tc,
00084                        const std::string& dbf_name, const std::string& shp_name,
00085                        bool speedInKMH);
00086 
00088     ~NIImporter_ArcView();
00089 
00090 
00093     void load();
00094 
00095 
00096 private:
00097 #ifdef HAVE_GDAL
00098 
00102     SUMOReal getSpeed(OGRFeature& f, const std::string& edgeid);
00103 
00104 
00110     unsigned int getLaneNo(OGRFeature& f,
00111                            const std::string& edgeid, SUMOReal speed);
00112 
00117     int getPriority(OGRFeature& f, const std::string& edgeid);
00118 
00119 
00127     void checkSpread(NBEdge* e);
00128 
00129 
00143     bool getStringEntry(OGRFeature*poFeature, const std::string &optionName, const char *defaultName, bool prune, std::string &into);
00144 #endif
00145 
00146 private:
00148     const OptionsCont& myOptions;
00149 
00151     std::string mySHPName;
00152 
00154     int myNameAddition;
00155 
00157     NBNodeCont& myNodeCont;
00158 
00160     NBEdgeCont& myEdgeCont;
00161 
00163     NBTypeCont& myTypeCont;
00164 
00166     bool mySpeedInKMH;
00167 
00169     int myRunningNodeID;
00170 
00171 
00172 private:
00174     NIImporter_ArcView(const NIImporter_ArcView&);
00175 
00177     NIImporter_ArcView& operator=(const NIImporter_ArcView&);
00178 
00179 };
00180 
00181 
00182 #endif
00183 
00184 /****************************************************************************/
00185 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines