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-2020 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
20 // Importer for networks stored in ArcView-shape format
21 /****************************************************************************/
22 #pragma once
23 #include <config.h>
24 
25 #include <string>
26 
27 
28 // ===========================================================================
29 // class declarations
30 // ===========================================================================
31 class OptionsCont;
32 class OGRFeature;
33 
34 
35 // ===========================================================================
36 // class definitions
37 // ===========================================================================
48 public:
60  static void loadNetwork(const OptionsCont& oc, NBNetBuilder& nb);
61 
62 
63 protected:
74  NBNodeCont& nc, NBEdgeCont& ec, NBTypeCont& tc,
75  const std::string& dbf_name, const std::string& shp_name,
76  bool speedInKMH);
77 
80 
81 
84  void load();
85 
86 
87 private:
88 #ifdef HAVE_GDAL
93  double getSpeed(OGRFeature& f, const std::string& edgeid);
94 
95 
101  int getLaneNo(OGRFeature& f,
102  const std::string& edgeid, double speed);
103 
108  int getPriority(OGRFeature& f, const std::string& edgeid);
109 
110 
118  void checkSpread(NBEdge* e);
119 
120 
134  bool getStringEntry(OGRFeature* poFeature, const std::string& optionName, const char* defaultName, bool prune, std::string& into);
135 
137  std::vector<std::string> getFieldNames(OGRFeature* poFeature) const;
138 
140  void addParams(NBEdge* edge, OGRFeature* poFeature, const std::vector<std::string>& params) const;
141 
142 #endif
143 
144 private:
147 
149  std::string mySHPName;
150 
153 
156 
159 
162 
165 
169 
170 
171 private:
174 
177 
178 };
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:59
The representation of a single edge during network building.
Definition: NBEdge.h:91
Instance responsible for building networks.
Definition: NBNetBuilder.h:107
Container for nodes during the netbuilding process.
Definition: NBNodeCont.h:58
A storage for available edgeTypes of edges.
Definition: NBTypeCont.h:52
Importer for networks stored in ArcView-shape format.
const OptionsCont & myOptions
The options to use.
void load()
Loads the shape files.
int myRunningEdgeID
A running number to assure unique ids (as fallback)
static void loadNetwork(const OptionsCont &oc, NBNetBuilder &nb)
Loads content of the optionally given ArcView Shape files.
std::string mySHPName
The name of the shape file.
NIImporter_ArcView(const NIImporter_ArcView &)
Invalidated copy constructor.
NBTypeCont & myTypeCont
The container to get the types from.
NBNodeCont & myNodeCont
The container to add nodes to.
int myNameAddition
A running number to assure unique edge ids.
bool mySpeedInKMH
Whether the speed is given in km/h.
~NIImporter_ArcView()
Destructor.
NIImporter_ArcView & operator=(const NIImporter_ArcView &)
Invalidated assignment operator.
NBEdgeCont & myEdgeCont
The container to add edges to.
NIImporter_ArcView(const OptionsCont &oc, NBNodeCont &nc, NBEdgeCont &ec, NBTypeCont &tc, const std::string &dbf_name, const std::string &shp_name, bool speedInKMH)
Constructor.
A storage for options typed value containers)
Definition: OptionsCont.h:89