Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/netimport/NINavTeqHelper.h
169666 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 NINavTeqHelper.h
15
/// @author Daniel Krajzewicz
16
/// @author Jakob Erdmann
17
/// @author Michael Behrisch
18
/// @date Jul 2006
19
///
20
// Some parser methods shared around several formats containing NavTeq-Nets
21
/****************************************************************************/
22
#pragma once
23
#include <config.h>
24
25
#include <string>
26
#include <utils/common/StdDefs.h>
27
#include <utils/common/SUMOVehicleClass.h>
28
#include <utils/common/UtilExceptions.h>
29
30
31
// ===========================================================================
32
// class declarations
33
// ===========================================================================
34
class NBEdge;
35
36
37
// ===========================================================================
38
// class definitions
39
// ===========================================================================
40
/**
41
* @class NINavTeqHelper
42
* @brief Some parser methods shared around several formats containing NavTeq-Nets
43
*
44
* Networks from NavTeq ofte use categories for speed limits and the number of lanes.
45
* This class parses such categories and converts them into proper values.
46
*/
47
class NINavTeqHelper {
48
public:
49
/** @brief Returns the speed evaluating the given Navteq-description
50
*
51
* This method tries to parse the speed category into its int-representation
52
* and to determine the speed that is assigned to the category.
53
* If either of both steps can not be perfored, a ProcessError is
54
* thrown.
55
*
56
* @param[in] id The id of the edge (for debug-output)
57
* @param[in] speedClassS The string that describes the speed class
58
* @return The converted speed (in m/s)
59
* @exception ProcessError If the given speed class definition is not a number or if it is not known
60
*/
61
static double getSpeed(const std::string& id,
62
const std::string& speedClassS);
63
64
65
/** @brief Returns the lane number evaluating the given Navteq-description
66
*
67
* @param[in] id The id of the edge (for debug-output)
68
* @param[in] laneNoS The string that describes the number of lanes
69
* @param[in] speed An additional hint for guessing the proper lane number
70
* @return The converted lane number
71
* @exception ProcessError If the given lane number definition is not a number or if it is not known
72
*/
73
static int getLaneNumber(const std::string& id,
74
const std::string& laneNoS, double speed);
75
76
77
/** @brief Adds vehicle classes parsing the given list of allowed vehicles
78
*
79
* Parses the given class-string and sets all set (allowed) vehicle types
80
* into the given edge using "addVehicleClass".
81
*
82
* @param[in] e The edge to set the parsed vehicle classes into
83
* @param[in] classS The string that contains the information whether a vehicle class is allowed
84
* @see addVehicleClass
85
*/
86
static void addVehicleClasses(NBEdge& e, const std::string& classS, const SVCPermissions allPermissions, const SVCPermissions defaultPermissions);
87
88
/// @brief same as addVehicleClasses but for version 6+
89
static void addVehicleClassesV6(NBEdge& e, const std::string& classS, const SVCPermissions allPermissions, const SVCPermissions defaultPermissions);
90
91
private:
92
static bool addCommonVehicleClasses(NBEdge& e, const std::string& classS, const int offset);
93
94
};
95
96