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-2018 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
17 // Importer for networks stored in ArcView-shape format
18 /****************************************************************************/
19 #ifndef NIImporter_ArcView_h
20 #define NIImporter_ArcView_h
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #include <config.h>
27 
28 #include <string>
29 
30 
31 // ===========================================================================
32 // class declarations
33 // ===========================================================================
34 class OptionsCont;
35 class OGRFeature;
36 
37 
38 // ===========================================================================
39 // class definitions
40 // ===========================================================================
51 public:
63  static void loadNetwork(const OptionsCont& oc, NBNetBuilder& nb);
64 
65 
66 protected:
77  NBNodeCont& nc, NBEdgeCont& ec, NBTypeCont& tc,
78  const std::string& dbf_name, const std::string& shp_name,
79  bool speedInKMH);
80 
83 
84 
87  void load();
88 
89 
90 private:
91 #ifdef HAVE_GDAL
92 
96  double getSpeed(OGRFeature& f, const std::string& edgeid);
97 
98 
104  int getLaneNo(OGRFeature& f,
105  const std::string& edgeid, double speed);
106 
111  int getPriority(OGRFeature& f, const std::string& edgeid);
112 
113 
121  void checkSpread(NBEdge* e);
122 
123 
137  bool getStringEntry(OGRFeature* poFeature, const std::string& optionName, const char* defaultName, bool prune, std::string& into);
138 
140  std::vector<std::string> getFieldNames(OGRFeature* poFeature) const;
141 
143  void addParams(NBEdge* edge, OGRFeature* poFeature, const std::vector<std::string>& params) const;
144 
145 #endif
146 
147 private:
150 
152  std::string mySHPName;
153 
156 
159 
162 
165 
168 
172 
173 
174 private:
177 
180 
181 };
182 
183 
184 #endif
185 
186 /****************************************************************************/
187 
int myNameAddition
A running number to assure unique edge ids.
~NIImporter_ArcView()
Destructor.
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:65
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:61
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:109
NBNodeCont & myNodeCont
The container to add nodes to.
A storage for options typed value containers)
Definition: OptionsCont.h:92
int myRunningEdgeID
A running number to assure unique ids (as fallback)
Container for nodes during the netbuilding process.
Definition: NBNodeCont.h:60
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:55