SUMO - Simulation of Urban MObility
NIImporter_ArcView.h
Go to the documentation of this file.
1 /****************************************************************************/
9 // Importer for networks stored in ArcView-shape format
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
12 // Copyright (C) 2002-2016 DLR (http://www.dlr.de/) and contributors
13 /****************************************************************************/
14 //
15 // This file is part of SUMO.
16 // SUMO is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 /****************************************************************************/
22 #ifndef NIImporter_ArcView_h
23 #define NIImporter_ArcView_h
24 
25 
26 // ===========================================================================
27 // included modules
28 // ===========================================================================
29 #ifdef _MSC_VER
30 #include <windows_config.h>
31 #else
32 #include <config.h>
33 #endif
34 
35 #include <string>
36 
37 
38 // ===========================================================================
39 // class declarations
40 // ===========================================================================
41 class OptionsCont;
42 class OGRFeature;
43 
44 
45 // ===========================================================================
46 // class definitions
47 // ===========================================================================
58 public:
70  static void loadNetwork(const OptionsCont& oc, NBNetBuilder& nb);
71 
72 
73 protected:
84  NBNodeCont& nc, NBEdgeCont& ec, NBTypeCont& tc,
85  const std::string& dbf_name, const std::string& shp_name,
86  bool speedInKMH);
87 
90 
91 
94  void load();
95 
96 
97 private:
98 #ifdef HAVE_GDAL
99 
103  SUMOReal getSpeed(OGRFeature& f, const std::string& edgeid);
104 
105 
111  int getLaneNo(OGRFeature& f,
112  const std::string& edgeid, SUMOReal speed);
113 
118  int getPriority(OGRFeature& f, const std::string& edgeid);
119 
120 
128  void checkSpread(NBEdge* e);
129 
130 
144  bool getStringEntry(OGRFeature* poFeature, const std::string& optionName, const char* defaultName, bool prune, std::string& into);
145 #endif
146 
147 private:
150 
152  std::string mySHPName;
153 
156 
159 
162 
165 
168 
171 
172 
173 private:
176 
179 
180 };
181 
182 
183 #endif
184 
185 /****************************************************************************/
186 
int myNameAddition
A running number to assure unique edge ids.
~NIImporter_ArcView()
Destructor.
int myRunningNodeID
A running number to assure unique node ids.
std::string mySHPName
The name of the shape file.
NBTypeCont & myTypeCont
The container to get the types from.
The representation of a single edge during network building.
Definition: NBEdge.h:71
static void loadNetwork(const OptionsCont &oc, NBNetBuilder &nb)
Loads content of the optionally given ArcView Shape files.
const OptionsCont & myOptions
The options to use.
void load()
Loads the shape files.
NIImporter_ArcView & operator=(const NIImporter_ArcView &)
Invalidated assignment operator.
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:66
Importer for networks stored in ArcView-shape format.
NIImporter_ArcView(const OptionsCont &oc, NBNodeCont &nc, NBEdgeCont &ec, NBTypeCont &tc, const std::string &dbf_name, const std::string &shp_name, bool speedInKMH)
Constructor.
Instance responsible for building networks.
Definition: NBNetBuilder.h:112
NBNodeCont & myNodeCont
The container to add nodes to.
A storage for options typed value containers)
Definition: OptionsCont.h:99
#define SUMOReal
Definition: config.h:213
Container for nodes during the netbuilding process.
Definition: NBNodeCont.h:63
NBEdgeCont & myEdgeCont
The container to add edges to.
bool mySpeedInKMH
Whether the speed is given in km/h.
A storage for available types of edges.
Definition: NBTypeCont.h:62