Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
NIImporter_ArcView.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2002-2024 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// ===========================================================================
31class OptionsCont;
32class OGRFeature;
33
34
35// ===========================================================================
36// class definitions
37// ===========================================================================
48public:
60 static void loadNetwork(const OptionsCont& oc, NBNetBuilder& nb);
61
62
63protected:
73 NBNodeCont& nc, NBEdgeCont& ec, NBTypeCont& tc,
74 const std::string& shp_name,
75 bool speedInKMH);
76
79
80
83 void load();
84
85
86private:
87#ifdef HAVE_GDAL
92 double getSpeed(OGRFeature& f, const std::string& edgeid);
93
98 double getLaneWidth(OGRFeature& f, const std::string& edgeid, int laneNumber);
99
104 double getLength(OGRFeature& f, const std::string& edgeid);
105
111 int getLaneNo(OGRFeature& f,
112 const std::string& edgeid, double 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
147 std::vector<std::string> getFieldNames(OGRFeature* poFeature) const;
148
150 void addParams(NBEdge* edge, OGRFeature* poFeature, const std::vector<std::string>& params) const;
151
152#endif
153
154private:
157
159 std::string mySHPName;
160
163
166
169
172
175
179
180
181private:
184
187
188};
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:92
Instance responsible for building networks.
Container for nodes during the netbuilding process.
Definition NBNodeCont.h:57
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.
NBEdgeCont & myEdgeCont
The container to add edges to.
NIImporter_ArcView & operator=(const NIImporter_ArcView &)
Invalidated assignment operator.
A storage for options typed value containers)
Definition OptionsCont.h:89