/****************************************************************************/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 NWWriter_XML.h14/// @author Daniel Krajzewicz15/// @author Jakob Erdmann16/// @author Michael Behrisch17/// @date Tue, 11.05.201118///19// Exporter writing networks using XML (native input) format20/****************************************************************************/21#pragma once22#include <config.h>2324#include <string>25#include <map>26#include <utils/xml/SUMOSAXHandler.h>27#include <utils/common/UtilExceptions.h>282930// ===========================================================================31// class declarations32// ===========================================================================33class NBEdge;34class NBEdgeCont;35class NBNetBuilder;36class NBNode;37class NBNodeCont;38class NBParkingCont;39class NBPTStopCont;40class NBPTLineCont;41class NBTrafficLightLogicCont;42class NBTypeCont;43class OptionsCont;444546// ===========================================================================47// class definitions48// ===========================================================================49/**50* @class NWWriter_XML51* @brief Exporter writing networks using XML (native input) format52*53*/54class NWWriter_XML {55public:56/** @brief Writes the network into XML-files (nodes, edges, connections,57* traffic lights)58* @param[in] oc The options to use59* @param[in] nb The network builder from which to read data60*/61static void writeNetwork(const OptionsCont& oc, const std::string& prefix, NBNetBuilder& nb);6263/** @brief Writes the joined-juncionts to file64* @param[in] oc The options to use65* @param[in] nc The node-container from which to read data66*/67static void writeJoinedJunctions(const std::string& filename, NBNodeCont& nc);6869/** @brief Writes street signs as POIs to file70* @param[in] oc The options to use71* @param[in] ec The edge-container from which to read data72*/73static void writeStreetSigns(const OptionsCont& oc, NBEdgeCont& ec);7475private:76/** @brief Writes the configuration file for assempling the network from plain-xml files77* @param[in] oc The options to use78* @param[in] prefix The file name prefix79*/80static void writeConfig(const OptionsCont& oc, const std::string& prefix, bool haveTypes);8182/** @brief Writes the nodes file83* @param[in] oc The options to use84* @param[in] nc The node-container from which to read data85*/86static void writeNodes(const OptionsCont& oc, const std::string& prefix, NBNodeCont& nc);8788/** @brief Writes the types file89* @param[in] oc The options to use90* @param[in] nc The type-container from which to read data91*/92static void writeTypes(const std::string& prefix, NBEdgeCont& ec, NBTypeCont& tc);9394/** @brief Writes the edges and connections files95* @param[in] oc The options to use96* @param[in] nb The network build from which to read data97*/98static void writeEdgesAndConnections(const OptionsCont& oc, const std::string& prefix, NBNodeCont& nc, NBEdgeCont& ec);99100101/** @brief Writes the traffic lights file102* @param[in] oc The options to use103* @param[in] tc The tll-container from which to read data104* @param[in] ec The edge-container from which to read data105*/106static void writeTrafficLights(const std::string& prefix, NBTrafficLightLogicCont& tc, NBEdgeCont& ec);107108/** @brief Writes the pt stops file109* @param[in] oc The options to use110* @param[in] nc The pt stop container from which to read data111*/112static void writePTStops(const OptionsCont& oc, NBPTStopCont& ec);113static void writePTLines(const OptionsCont& cont, NBPTLineCont& lc);114115/// @brief writes imported parking areas to file116static void writeParkingAreas(const OptionsCont& cont, NBParkingCont& pc, NBEdgeCont& ec);117118/// @brief writes imported districts (TAZ) to file119static void writeDistricts(const OptionsCont& oc, NBDistrictCont& dc);120121static void writeShape(OutputDevice& out, const GeoConvHelper& gch, PositionVector shape, SumoXMLAttr attr, bool useGeo, bool geoAccuracy);122};123124125