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-2023 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:
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
87private:
88#ifdef HAVE_GDAL
93 double getSpeed(OGRFeature& f, const std::string& edgeid);
94
99 double getLaneWidth(OGRFeature& f, const std::string& edgeid, int laneNumber);
100
105 double getLength(OGRFeature& f, const std::string& edgeid);
106
112 int getLaneNo(OGRFeature& f,
113 const std::string& edgeid, double speed);
114
119 int getPriority(OGRFeature& f, const std::string& edgeid);
120
121
129 void checkSpread(NBEdge* e);
130
131
145 bool getStringEntry(OGRFeature* poFeature, const std::string& optionName, const char* defaultName, bool prune, std::string& into);
146
148 std::vector<std::string> getFieldNames(OGRFeature* poFeature) const;
149
151 void addParams(NBEdge* edge, OGRFeature* poFeature, const std::vector<std::string>& params) const;
152
153#endif
154
155private:
158
160 std::string mySHPName;
161
164
167
170
173
176
180
181
182private:
185
188
189};
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