mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-23 22:53:43 +00:00
Merge commit '05cc660641' into traffic
# Conflicts: # CMakeLists.txt # android/app/src/main/java/app/organicmaps/settings/SettingsPrefsFragment.java # android/sdk/src/main/cpp/app/organicmaps/sdk/Framework.hpp # android/sdk/src/main/cpp/app/organicmaps/sdk/OrganicMaps.cpp # android/sdk/src/main/cpp/app/organicmaps/sdk/util/Config.cpp # libs/indexer/data_source.hpp # libs/indexer/feature.hpp # libs/indexer/ftypes_matcher.hpp # libs/map/framework.cpp # libs/map/traffic_manager.cpp # libs/routing/absent_regions_finder.cpp # libs/routing/edge_estimator.hpp # libs/routing/index_router.cpp # libs/routing/index_router.hpp # libs/routing/routing_session.hpp # libs/routing_common/num_mwm_id.hpp # libs/traffic/traffic_info.cpp # qt/mainwindow.hpp # qt/preferences_dialog.cpp # tools/openlr/helpers.hpp # tools/openlr/openlr_decoder.cpp # tools/openlr/openlr_decoder.hpp # tools/openlr/openlr_stat/openlr_stat.cpp # tools/openlr/router.hpp # tools/openlr/score_candidate_paths_getter.cpp # tools/openlr/score_candidate_paths_getter.hpp # xcode/CoMaps.xcworkspace/contents.xcworkspacedata
This commit is contained in:
56
tools/openlr/decoded_path.hpp
Normal file
56
tools/openlr/decoded_path.hpp
Normal file
@@ -0,0 +1,56 @@
|
||||
#pragma once
|
||||
|
||||
#include "routing/road_graph.hpp"
|
||||
|
||||
#include "base/exception.hpp"
|
||||
#include "base/newtype.hpp"
|
||||
|
||||
#include <cstdint>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <pugixml.hpp>
|
||||
|
||||
class DataSource;
|
||||
|
||||
namespace openlr
|
||||
{
|
||||
using Path = routing::RoadGraphBase::EdgeVector;
|
||||
using routing::Edge;
|
||||
|
||||
NEWTYPE(uint32_t, PartnerSegmentId);
|
||||
NEWTYPE_SIMPLE_OUTPUT(PartnerSegmentId);
|
||||
|
||||
DECLARE_EXCEPTION(DecodedPathLoadError, RootException);
|
||||
DECLARE_EXCEPTION(DecodedPathSaveError, RootException);
|
||||
|
||||
struct DecodedPath
|
||||
{
|
||||
PartnerSegmentId m_segmentId;
|
||||
std::string m_messageId;
|
||||
Path m_path;
|
||||
};
|
||||
|
||||
uint32_t UintValueFromXML(pugi::xml_node const & node);
|
||||
|
||||
void WriteAsMappingForSpark(std::string const & fileName, std::vector<DecodedPath> const & paths);
|
||||
void WriteAsMappingForSpark(std::ostream & ost, std::vector<DecodedPath> const & paths);
|
||||
|
||||
void PathFromXML(pugi::xml_node const & node, DataSource const & dataSource, Path & path);
|
||||
void PathToXML(Path const & path, pugi::xml_node & node);
|
||||
} // namespace openlr
|
||||
|
||||
namespace routing
|
||||
{
|
||||
inline m2::PointD GetStart(Edge const & e)
|
||||
{
|
||||
return e.GetStartJunction().GetPoint();
|
||||
}
|
||||
inline m2::PointD GetEnd(Edge const & e)
|
||||
{
|
||||
return e.GetEndJunction().GetPoint();
|
||||
}
|
||||
|
||||
std::vector<m2::PointD> GetPoints(routing::RoadGraphBase::EdgeVector const & p);
|
||||
} // namespace routing
|
||||
Reference in New Issue
Block a user