/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2012-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 NWWriter_DlrNavteq.h14/// @author Jakob Erdmann15/// @author Michael Behrisch16/// @date 26.10.201217///18// Exporter writing networks using DlrNavteq (Elmar) format19/****************************************************************************/20#pragma once21#include <config.h>2223#include <string>24#include <map>25#include <utils/xml/SUMOSAXHandler.h>26#include <utils/common/UtilExceptions.h>272829// ===========================================================================30// class declarations31// ===========================================================================32class NBEdge;33class NBEdgeCont;34class NBNetBuilder;35class NBNode;36class NBNodeCont;37class NBTrafficLightLogicCont;38class NBTypeCont;39class OptionsCont;404142// ===========================================================================43// class definitions44// ===========================================================================45/**46* @class NWWriter_DlrNavteq47* @brief Exporter writing networks using XML (native input) format48*49*/50class NWWriter_DlrNavteq {51public:52/** @brief Writes the network into XML-files (nodes, edges, connections,53* traffic lights)54* @param[in] oc The options to use55* @param[in] nb The network builder from which to read data56*/57static void writeNetwork(const OptionsCont& oc, NBNetBuilder& nb);5859/// @brief get the navteq road class60static int getRoadClass(const NBEdge* const edge);6162/// @brief get the navteq brunnel type63static int getBrunnelType(const NBEdge* const edge);6465/// @brief get the form of way66static int getFormOfWay(const NBEdge* const edge);6768private:69/** @brief Writes the nodes_unsplitted file70* @param[in] oc The options to use71* @param[in] nc The node-container from which to read data72* @param[in] ec The edge-container from which to read data73* @param[out] internalNodes The internal node ids, generated for edges with complex geometry74*/75static void writeNodesUnsplitted(const OptionsCont& oc, const NBNodeCont& nc, const NBEdgeCont& ec, std::map<const NBEdge*, std::string>& internalNodes);7677/** @brief Writes the links_unsplitted file78* @param[in] oc The options to use79* @param[in] ec The edge-container from which to read data80* @param[int] internalNodes The internal node ids, generated for edges with complex geometry81*/82static void writeLinksUnsplitted(const OptionsCont& oc, const NBEdgeCont& ec, const std::map<const NBEdge*, std::string>& internalNodes);8384/** @brief Writes the traffic_signals file85* @param[in] oc The options to use86* @param[in] nc The node-container from which to read data87*/88static void writeTrafficSignals(const OptionsCont& oc, NBNodeCont& nc);899091/** @brief Writes the prohibited_manoeuvres file92* @param[in] oc The options to use93* @param[in] nc The node-container from which to read data94*/95static void writeProhibitedManoeuvres(const OptionsCont& oc, const NBNodeCont& nc, const NBEdgeCont& ec);9697/** @brief Writes the connected_lanes file98* @param[in] oc The options to use99* @param[in] nc The node-container from which to read data100*/101static void writeConnectedLanes(const OptionsCont& oc, NBNodeCont& nc);102103/// @brief write header comments (input paramters, date, etc...)104static void writeHeader(OutputDevice& device, const OptionsCont& oc);105106/// @brief build the ascii-bit-vector for column vehicle_type107static std::string getAllowedTypes(SVCPermissions permissions);108109/// @brief get the navteq speed class based on the speed in km/h110static int getSpeedCategory(int kph);111112/// @brief get the SPEED_LIMIT as defined by elmar (upper bound of speed category)113static int getSpeedCategoryUpperBound(int kph);114115/// @brief get the lane number encoding116static int getNavteqLaneCode(const int numLanes);117118/// @brief get the length of the edge when measured up to the junction center119static double getGraphLength(const NBEdge* const edge);120121static std::string getSinglePostalCode(const std::string& zipCode, const std::string edgeID);122123/// @brief magic value for undefined stuff124static const std::string UNDEFINED;125126/// @brief get edge speed rounded to kmh127static inline int speedInKph(double metersPerSecond) {128return (int)std::floor(metersPerSecond * 3.6 + 0.5);129}130};131132133