Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/polyconvert/PCLoaderVisum.h
169667 views
1
/****************************************************************************/
2
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3
// Copyright (C) 2001-2025 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
/****************************************************************************/
14
/// @file PCLoaderVisum.h
15
/// @author Daniel Krajzewicz
16
/// @author Michael Behrisch
17
/// @date Thu, 02.11.2006
18
///
19
// A reader of pois and polygons stored in VISUM-format
20
/****************************************************************************/
21
#pragma once
22
#include <config.h>
23
24
#include <string>
25
#include "PCPolyContainer.h"
26
#include "PCTypeMap.h"
27
28
29
// ===========================================================================
30
// class definitions
31
// ===========================================================================
32
class OptionsCont;
33
34
35
// ===========================================================================
36
// class declarations
37
// ===========================================================================
38
/**
39
* @class PCLoaderVisum
40
* @brief A reader of pois and polygons stored in VISUM-format
41
*/
42
class PCLoaderVisum {
43
public:
44
/** @brief Loads pois/polygons assumed to be stored using VISUM-format
45
*
46
* If the option "visum-files" is set within the given options container,
47
* the files stored herein are parsed using "load", assuming this
48
* option contains file paths to files containing pois and polygons stored
49
* in VISUM ".net"-format.
50
*
51
* @param[in] oc The options container to get further options from
52
* @param[in] toFill The poly/pois container to add loaded polys/pois to
53
* @param[in] tm The type map to use for setting values of loaded polys/pois
54
* @exception ProcessError if something fails
55
*/
56
static void loadIfSet(OptionsCont& oc, PCPolyContainer& toFill,
57
PCTypeMap& tm);
58
59
60
protected:
61
/** @brief Parses pois/polys stored within the given file
62
* @param[in] oc The options container to get further options from
63
* @param[in] toFill The poly/pois container to add loaded polys/pois to
64
* @param[in] tm The type map to use for setting values of loaded polys/pois
65
* @exception ProcessError if something fails
66
*/
67
static void load(const std::string& file, OptionsCont& oc, PCPolyContainer& toFill,
68
PCTypeMap& tm);
69
70
71
/**
72
* @enum VISUM keys
73
* @brief Numbers representing VISUM keywords
74
*/
75
enum VISUM_KEY {
76
VISUM_SYS,
77
VISUM_LINKTYPE,
78
VISUM_NODE,
79
VISUM_DISTRICT,
80
VISUM_POINT,
81
VISUM_LINK,
82
VISUM_V0,
83
VISUM_TYPES,
84
VISUM_RANK,
85
VISUM_CAPACITY,
86
VISUM_XCOORD,
87
VISUM_YCOORD,
88
VISUM_FROMNODE,
89
VISUM_TONODE,
90
VISUM_TYPE,
91
VISUM_TYP,
92
VISUM_ID,
93
VISUM_CODE,
94
VISUM_DISTRICT_CONNECTION,
95
VISUM_SOURCE_DISTRICT,
96
VISUM_FROMNODENO,
97
VISUM_DIRECTION,
98
VISUM_SURFACEID,
99
VISUM_FACEID,
100
VISUM_FROMPOINTID,
101
VISUM_TOPOINTID,
102
VISUM_EDGE,
103
VISUM_VIANODENO,
104
VISUM_NUMLANES,
105
VISUM_TURN,
106
VISUM_INDEX,
107
VISUM_LINKPOLY,
108
VISUM_SURFACEITEM,
109
VISUM_FACEITEM,
110
VISUM_EDGEID,
111
VISUM_ORIGIN,
112
VISUM_DESTINATION,
113
// polyconvert keys added to avoid warnings
114
VISUM_CATID,
115
VISUM_EDGEITEM,
116
VISUM_POICATEGORY,
117
VISUM_NO // must be the last one
118
};
119
120
/// Strings for the keywords
121
static StringBijection<VISUM_KEY>::Entry KEYS_DE[];
122
123
/// @brief link directions
124
static StringBijection<VISUM_KEY> KEYS;
125
126
static void loadLanguage(const std::string& file);
127
};
128
129