|
SUMO - Simulation of Urban MObility
|
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 #endif 00129 00130 private: 00132 const OptionsCont& myOptions; 00133 00135 std::string mySHPName; 00136 00138 int myNameAddition; 00139 00141 NBNodeCont& myNodeCont; 00142 00144 NBEdgeCont& myEdgeCont; 00145 00147 NBTypeCont& myTypeCont; 00148 00150 bool mySpeedInKMH; 00151 00153 int myRunningNodeID; 00154 00155 00156 private: 00158 NIImporter_ArcView(const NIImporter_ArcView&); 00159 00161 NIImporter_ArcView& operator=(const NIImporter_ArcView&); 00162 00163 }; 00164 00165 00166 #endif 00167 00168 /****************************************************************************/ 00169