|
SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00007 // Importer for networks stored in ArcView-shape format 00008 /****************************************************************************/ 00009 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ 00010 // Copyright (C) 2001-2011 DLR (http://www.dlr.de/) and contributors 00011 /****************************************************************************/ 00012 // 00013 // This program is free software; you can redistribute it and/or modify 00014 // it under the terms of the GNU General Public License as published by 00015 // the Free Software Foundation; either version 2 of the License, or 00016 // (at your option) any later version. 00017 // 00018 /****************************************************************************/ 00019 #ifndef NIImporter_ArcView_h 00020 #define NIImporter_ArcView_h 00021 00022 00023 // =========================================================================== 00024 // included modules 00025 // =========================================================================== 00026 #ifdef _MSC_VER 00027 #include <windows_config.h> 00028 #else 00029 #include <config.h> 00030 #endif 00031 00032 #include <string> 00033 00034 00035 // =========================================================================== 00036 // class declarations 00037 // =========================================================================== 00038 class OptionsCont; 00039 class OGRFeature; 00040 00041 00042 // =========================================================================== 00043 // class definitions 00044 // =========================================================================== 00054 class NIImporter_ArcView { 00055 public: 00067 static void loadNetwork(const OptionsCont& oc, NBNetBuilder& nb); 00068 00069 00070 protected: 00080 NIImporter_ArcView(const OptionsCont& oc, 00081 NBNodeCont& nc, NBEdgeCont& ec, NBTypeCont& tc, 00082 const std::string& dbf_name, const std::string& shp_name, 00083 bool speedInKMH); 00084 00086 ~NIImporter_ArcView(); 00087 00088 00091 void load(); 00092 00093 00094 private: 00095 #ifdef HAVE_GDAL 00096 00100 SUMOReal getSpeed(OGRFeature& f, const std::string& edgeid); 00101 00102 00108 unsigned int getLaneNo(OGRFeature& f, 00109 const std::string& edgeid, SUMOReal speed); 00110 00115 int getPriority(OGRFeature& f, const std::string& edgeid); 00116 00117 00125 void checkSpread(NBEdge* e); 00126 #endif 00127 00128 private: 00130 const OptionsCont& myOptions; 00131 00133 std::string mySHPName; 00134 00136 int myNameAddition; 00137 00139 NBNodeCont& myNodeCont; 00140 00142 NBEdgeCont& myEdgeCont; 00143 00145 NBTypeCont& myTypeCont; 00146 00148 bool mySpeedInKMH; 00149 00151 int myRunningNodeID; 00152 00153 00154 private: 00156 NIImporter_ArcView(const NIImporter_ArcView&); 00157 00159 NIImporter_ArcView& operator=(const NIImporter_ArcView&); 00160 00161 }; 00162 00163 00164 #endif 00165 00166 /****************************************************************************/ 00167