MCPcopy Create free account
hub / github.com/comaps/comaps / LogAs2GisPath

Function LogAs2GisPath

tools/openlr/helpers.cpp:130–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128}
129
130string LogAs2GisPath(Graph::EdgeVector const & path)
131{
132 CHECK(!path.empty(), ("Paths should not be empty"));
133
134 ostringstream ost;
135 ost << "https://2gis.ru/moscow?queryState=";
136
137 auto ll = mercator::ToLatLon(path.front().GetStartPoint());
138 ost << "center%2F" << ll.m_lon << "%2C" << ll.m_lat << "%2F";
139 ost << "zoom%2F" << 17 << "%2F";
140 ost << "ruler%2Fpoints%2F";
141 for (auto const & e : path)
142 {
143 ll = mercator::ToLatLon(e.GetStartPoint());
144 ost << ll.m_lon << "%20" << ll.m_lat << "%2C";
145 }
146 ll = mercator::ToLatLon(path.back().GetEndPoint());
147 ost << ll.m_lon << "%20" << ll.m_lat;
148
149 return ost.str();
150}
151
152string LogAs2GisPath(Graph::Edge const & e)
153{

Callers 3

ValidatePathFunction · 0.85
GetLineCandidatesMethod · 0.85
GetLineCandidatesMethod · 0.85

Calls 6

frontMethod · 0.80
backMethod · 0.80
ToLatLonFunction · 0.50
emptyMethod · 0.45
GetStartPointMethod · 0.45
GetEndPointMethod · 0.45

Tested by

no test coverage detected