Eclipse 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-2019 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 /****************************************************************************/
16 // Importer for networks stored in ArcView-shape format
17 /****************************************************************************/
18 #ifndef NIImporter_ArcView_h
19 #define NIImporter_ArcView_h
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
27 #include <string>
28 
29 
30 // ===========================================================================
31 // class declarations
32 // ===========================================================================
33 class OptionsCont;
34 class OGRFeature;
35 
36 
37 // ===========================================================================
38 // class definitions
39 // ===========================================================================
50 public:
62  static void loadNetwork(const OptionsCont& oc, NBNetBuilder& nb);
63 
64 
65 protected:
76  NBNodeCont& nc, NBEdgeCont& ec, NBTypeCont& tc,
77  const std::string& dbf_name, const std::string& shp_name,
78  bool speedInKMH);
79 
82 
83 
86  void load();
87 
88 
89 private:
90 #ifdef HAVE_GDAL
91 
95  double getSpeed(OGRFeature& f, const std::string& edgeid);
96 
97 
103  int getLaneNo(OGRFeature& f,
104  const std::string& edgeid, double speed);
105 
110  int getPriority(OGRFeature& f, const std::string& edgeid);
111 
112 
120  void checkSpread(NBEdge* e);
121 
122 
136  bool getStringEntry(OGRFeature* poFeature, const std::string& optionName, const char* defaultName, bool prune, std::string& into);
137 
139  std::vector<std::string> getFieldNames(OGRFeature* poFeature) const;
140 
142  void addParams(NBEdge* edge, OGRFeature* poFeature, const std::vector<std::string>& params) const;
143 
144 #endif
145 
146 private:
149 
151  std::string mySHPName;
152 
155 
158 
161 
164 
167 
171 
172 
173 private:
176 
179 
180 };
181 
182 
183 #endif
184 
185 /****************************************************************************/
186 
NIImporter_ArcView::myNameAddition
int myNameAddition
A running number to assure unique edge ids.
Definition: NIImporter_ArcView.h:154
NBEdgeCont
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:60
NBNetBuilder
Instance responsible for building networks.
Definition: NBNetBuilder.h:109
NIImporter_ArcView::myRunningNodeID
int myRunningNodeID
Definition: NIImporter_ArcView.h:170
NIImporter_ArcView::NIImporter_ArcView
NIImporter_ArcView(const NIImporter_ArcView &)
Invalidated copy constructor.
NBNodeCont
Container for nodes during the netbuilding process.
Definition: NBNodeCont.h:59
NBEdge
The representation of a single edge during network building.
Definition: NBEdge.h:91
NIImporter_ArcView::~NIImporter_ArcView
~NIImporter_ArcView()
Destructor.
Definition: NIImporter_ArcView.cpp:117
NIImporter_ArcView::operator=
NIImporter_ArcView & operator=(const NIImporter_ArcView &)
Invalidated assignment operator.
NIImporter_ArcView::myTypeCont
NBTypeCont & myTypeCont
The container to get the types from.
Definition: NIImporter_ArcView.h:163
NIImporter_ArcView::loadNetwork
static void loadNetwork(const OptionsCont &oc, NBNetBuilder &nb)
Loads content of the optionally given ArcView Shape files.
Definition: NIImporter_ArcView.cpp:66
NIImporter_ArcView::mySpeedInKMH
bool mySpeedInKMH
Whether the speed is given in km/h.
Definition: NIImporter_ArcView.h:166
OptionsCont
A storage for options typed value containers)
Definition: OptionsCont.h:89
NIImporter_ArcView::load
void load()
Loads the shape files.
Definition: NIImporter_ArcView.cpp:121
NIImporter_ArcView::myRunningEdgeID
int myRunningEdgeID
A running number to assure unique ids (as fallback)
Definition: NIImporter_ArcView.h:169
NIImporter_ArcView::myOptions
const OptionsCont & myOptions
The options to use.
Definition: NIImporter_ArcView.h:148
NIImporter_ArcView::NIImporter_ArcView
NIImporter_ArcView(const OptionsCont &oc, NBNodeCont &nc, NBEdgeCont &ec, NBTypeCont &tc, const std::string &dbf_name, const std::string &shp_name, bool speedInKMH)
Constructor.
Definition: NIImporter_ArcView.cpp:100
NBTypeCont
A storage for available types of edges.
Definition: NBTypeCont.h:54
config.h
NIImporter_ArcView::myNodeCont
NBNodeCont & myNodeCont
The container to add nodes to.
Definition: NIImporter_ArcView.h:157
NIImporter_ArcView
Importer for networks stored in ArcView-shape format.
Definition: NIImporter_ArcView.h:49
NIImporter_ArcView::myEdgeCont
NBEdgeCont & myEdgeCont
The container to add edges to.
Definition: NIImporter_ArcView.h:160
NIImporter_ArcView::mySHPName
std::string mySHPName
The name of the shape file.
Definition: NIImporter_ArcView.h:151