/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others.3// This program and the accompanying materials are made available under the4// terms of the Eclipse Public License 2.0 which is available at5// https://www.eclipse.org/legal/epl-2.0/6// This Source Code may also be made available under the following Secondary7// Licenses when the conditions for such availability set forth in the Eclipse8// Public License 2.0 are satisfied: GNU General Public License, version 29// or later which is available at10// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html11// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later12/****************************************************************************/13/// @file NINavTeqHelper.h14/// @author Daniel Krajzewicz15/// @author Jakob Erdmann16/// @author Michael Behrisch17/// @date Jul 200618///19// Some parser methods shared around several formats containing NavTeq-Nets20/****************************************************************************/21#pragma once22#include <config.h>2324#include <string>25#include <utils/common/StdDefs.h>26#include <utils/common/SUMOVehicleClass.h>27#include <utils/common/UtilExceptions.h>282930// ===========================================================================31// class declarations32// ===========================================================================33class NBEdge;343536// ===========================================================================37// class definitions38// ===========================================================================39/**40* @class NINavTeqHelper41* @brief Some parser methods shared around several formats containing NavTeq-Nets42*43* Networks from NavTeq ofte use categories for speed limits and the number of lanes.44* This class parses such categories and converts them into proper values.45*/46class NINavTeqHelper {47public:48/** @brief Returns the speed evaluating the given Navteq-description49*50* This method tries to parse the speed category into its int-representation51* and to determine the speed that is assigned to the category.52* If either of both steps can not be perfored, a ProcessError is53* thrown.54*55* @param[in] id The id of the edge (for debug-output)56* @param[in] speedClassS The string that describes the speed class57* @return The converted speed (in m/s)58* @exception ProcessError If the given speed class definition is not a number or if it is not known59*/60static double getSpeed(const std::string& id,61const std::string& speedClassS);626364/** @brief Returns the lane number evaluating the given Navteq-description65*66* @param[in] id The id of the edge (for debug-output)67* @param[in] laneNoS The string that describes the number of lanes68* @param[in] speed An additional hint for guessing the proper lane number69* @return The converted lane number70* @exception ProcessError If the given lane number definition is not a number or if it is not known71*/72static int getLaneNumber(const std::string& id,73const std::string& laneNoS, double speed);747576/** @brief Adds vehicle classes parsing the given list of allowed vehicles77*78* Parses the given class-string and sets all set (allowed) vehicle types79* into the given edge using "addVehicleClass".80*81* @param[in] e The edge to set the parsed vehicle classes into82* @param[in] classS The string that contains the information whether a vehicle class is allowed83* @see addVehicleClass84*/85static void addVehicleClasses(NBEdge& e, const std::string& classS, const SVCPermissions allPermissions, const SVCPermissions defaultPermissions);8687/// @brief same as addVehicleClasses but for version 6+88static void addVehicleClassesV6(NBEdge& e, const std::string& classS, const SVCPermissions allPermissions, const SVCPermissions defaultPermissions);8990private:91static bool addCommonVehicleClasses(NBEdge& e, const std::string& classS, const int offset);9293};949596