SUMO - Simulation of Urban MObility
NIImporter_ArcView.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2002-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
19 // Importer for networks stored in ArcView-shape format
20 /****************************************************************************/
21 #ifndef NIImporter_ArcView_h
22 #define NIImporter_ArcView_h
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #include <string>
35 
36 
37 // ===========================================================================
38 // class declarations
39 // ===========================================================================
40 class OptionsCont;
41 class OGRFeature;
42 
43 
44 // ===========================================================================
45 // class definitions
46 // ===========================================================================
57 public:
69  static void loadNetwork(const OptionsCont& oc, NBNetBuilder& nb);
70 
71 
72 protected:
83  NBNodeCont& nc, NBEdgeCont& ec, NBTypeCont& tc,
84  const std::string& dbf_name, const std::string& shp_name,
85  bool speedInKMH);
86 
89 
90 
93  void load();
94 
95 
96 private:
97 #ifdef HAVE_GDAL
98 
102  double getSpeed(OGRFeature& f, const std::string& edgeid);
103 
104 
110  int getLaneNo(OGRFeature& f,
111  const std::string& edgeid, double speed);
112 
117  int getPriority(OGRFeature& f, const std::string& edgeid);
118 
119 
127  void checkSpread(NBEdge* e);
128 
129 
143  bool getStringEntry(OGRFeature* poFeature, const std::string& optionName, const char* defaultName, bool prune, std::string& into);
144 #endif
145 
146 private:
149 
151  std::string mySHPName;
152 
155 
158 
161 
164 
167 
170 
171 
172 private:
175 
178 
179 };
180 
181 
182 #endif
183 
184 /****************************************************************************/
185 
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:70
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:115
NBNodeCont & myNodeCont
The container to add nodes to.
A storage for options typed value containers)
Definition: OptionsCont.h:98
Container for nodes during the netbuilding process.
Definition: NBNodeCont.h:66
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:61