forked from organicmaps/organicmaps
OSRM build fixes
This commit is contained in:
parent
c8fa5b9ae9
commit
7dc3d2e13a
6 changed files with 30 additions and 30 deletions
|
@ -196,9 +196,13 @@ target_link_libraries(osrm-mapsme ${Boost_LIBRARIES} OSRM
|
|||
debug "${CMAKE_SOURCE_DIR}/../../../../omim-build-debug/out/debug/libcoding.a"
|
||||
"${CMAKE_SOURCE_DIR}/../../../../omim-build-debug/out/debug/libbase.a"
|
||||
"${CMAKE_SOURCE_DIR}/../../../../omim-build-debug/out/debug/librouting.a"
|
||||
"${CMAKE_SOURCE_DIR}/../../../../omim-build-debug/out/debug/libindexer.a"
|
||||
"${CMAKE_SOURCE_DIR}/../../../../omim-build-debug/out/debug/libgeometry.a"
|
||||
general "${CMAKE_SOURCE_DIR}/../../../../omim-build-release/out/release/libcoding.a"
|
||||
"${CMAKE_SOURCE_DIR}/../../../../omim-build-release/out/release/libbase.a"
|
||||
"${CMAKE_SOURCE_DIR}/../../../../omim-build-release/out/release/librouting.a")
|
||||
"${CMAKE_SOURCE_DIR}/../../../../omim-build-release/out/release/librouting.a"
|
||||
"${CMAKE_SOURCE_DIR}/../../../../omim-build-release/out/release/libindexer.a"
|
||||
"${CMAKE_SOURCE_DIR}/../../../../omim-build-release/out/release/libgeometry.a")
|
||||
|
||||
find_package(Threads REQUIRED)
|
||||
target_link_libraries(osrm-extract ${CMAKE_THREAD_LIBS_INIT} ${OPTIONAL_OMP_LIB})
|
||||
|
|
|
@ -151,14 +151,14 @@ void GenerateRoutingIndex(const std::string & fPath)
|
|||
CHECK(data.shortcut == shortcuts.back(), ());
|
||||
|
||||
auto const last = edgesData.back();
|
||||
if (data.distance <= last)
|
||||
if (static_cast<uint32_t>(data.distance) <= last)
|
||||
{
|
||||
if (!edgeId.empty() && data.shortcut)
|
||||
{
|
||||
CHECK(shortcuts.back(), ());
|
||||
unsigned oldId = node - bits::ZigZagDecode(edgeId.back());
|
||||
|
||||
if (data.distance == last)
|
||||
if (static_cast<uint32_t>(data.distance) == last)
|
||||
edgeId.back() = compressId(min(oldId, data.id));
|
||||
else
|
||||
edgeId.back() = compressId(data.id);
|
||||
|
@ -266,7 +266,6 @@ void GenerateRoutingIndex(const std::string & fPath)
|
|||
std::cout << "Check edges data ...";
|
||||
bool error = false;
|
||||
|
||||
typedef vector<QueryEdge::EdgeData> EdgeDataT;
|
||||
assert(facade.GetNumberOfEdges() == facadeNew.GetNumberOfEdges());
|
||||
for (uint32_t i = 0; i < facade.GetNumberOfNodes(); ++i)
|
||||
{
|
||||
|
|
|
@ -104,7 +104,8 @@ void BuildRoutingIndex(string const & baseDir, string const & countryName, strin
|
|||
// Check mwm borders crossing.
|
||||
for (m2::RegionD const & border: regionBorders)
|
||||
{
|
||||
bool const outStart = border.Contains({ startSeg.lon1, startSeg.lat1 }), outEnd = border.Contains({ endSeg.lon2, endSeg.lat2 });
|
||||
bool const outStart = border.Contains({ startSeg.lon1, startSeg.lat1 });
|
||||
bool const outEnd = border.Contains({ endSeg.lon2, endSeg.lat2 });
|
||||
if (outStart == outEnd)
|
||||
continue;
|
||||
m2::PointD intersection = m2::PointD::Zero();
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
namespace routing
|
||||
{
|
||||
|
||||
uint32_t const g_coordBits = POINT_COORD_BITS;
|
||||
static uint32_t const g_coordBits = POINT_COORD_BITS;
|
||||
|
||||
void OutgoingCrossNode::Save(Writer &w) const
|
||||
{
|
||||
|
@ -61,18 +61,17 @@ void CrossRoutingContextReader::Load(Reader const & r)
|
|||
r.Read(pos, &size, sizeof(size));
|
||||
pos += sizeof(size);
|
||||
m_ingoingNodes.resize(size);
|
||||
for (int i = 0; i < size; ++i)
|
||||
{
|
||||
pos = m_ingoingNodes[i].Load(r, pos);
|
||||
}
|
||||
|
||||
for (auto & node : m_ingoingNodes)
|
||||
pos = node.Load(r, pos);
|
||||
|
||||
r.Read(pos, &size, sizeof(size));
|
||||
pos += sizeof(size);
|
||||
m_outgoingNodes.resize(size);
|
||||
for (int i = 0; i < size; ++i)
|
||||
{
|
||||
pos = m_outgoingNodes[i].Load(r, pos);
|
||||
}
|
||||
|
||||
for (auto & node : m_outgoingNodes)
|
||||
pos = node.Load(r, pos);
|
||||
|
||||
size_t const adjMatrixSize = sizeof(WritedEdgeWeightT) * m_ingoingNodes.size() * m_outgoingNodes.size();
|
||||
mp_reader = unique_ptr<Reader>(r.CreateSubReader(pos, adjMatrixSize));
|
||||
pos += adjMatrixSize;
|
||||
|
@ -130,17 +129,14 @@ void CrossRoutingContextWriter::Save(Writer & w)
|
|||
{
|
||||
uint32_t size = static_cast<uint32_t>(m_ingoingNodes.size());
|
||||
w.Write(&size, sizeof(size));
|
||||
for (int i = 0; i < size; ++i)
|
||||
{
|
||||
m_ingoingNodes[i].Save(w);
|
||||
}
|
||||
for (auto const & node : m_ingoingNodes)
|
||||
node.Save(w);
|
||||
|
||||
size = static_cast<uint32_t>(m_outgoingNodes.size());
|
||||
w.Write(&size, sizeof(size));
|
||||
for (int i = 0; i < size; ++i)
|
||||
{
|
||||
m_outgoingNodes[i].Save(w);
|
||||
}
|
||||
|
||||
for (auto const & node : m_outgoingNodes)
|
||||
node.Save(w);
|
||||
|
||||
CHECK(m_adjacencyMatrix.size() == m_outgoingNodes.size()*m_ingoingNodes.size(), ());
|
||||
w.Write(&m_adjacencyMatrix[0], sizeof(m_adjacencyMatrix[0]) * m_adjacencyMatrix.size());
|
||||
|
|
|
@ -15,11 +15,11 @@ static WritedEdgeWeightT const INVALID_CONTEXT_EDGE_NODE_ID = std::numeric_limit
|
|||
|
||||
struct IngoingCrossNode
|
||||
{
|
||||
uint32_t m_nodeId;
|
||||
m2::PointD m_point;
|
||||
uint32_t m_nodeId;
|
||||
|
||||
IngoingCrossNode() : m_nodeId(INVALID_CONTEXT_EDGE_NODE_ID), m_point(m2::PointD::Zero()) {}
|
||||
IngoingCrossNode(uint32_t nodeId, m2::PointD const & point) : m_nodeId(nodeId), m_point(point) {}
|
||||
IngoingCrossNode() : m_point(m2::PointD::Zero()), m_nodeId(INVALID_CONTEXT_EDGE_NODE_ID) {}
|
||||
IngoingCrossNode(uint32_t nodeId, m2::PointD const & point) :m_point(point), m_nodeId(nodeId) {}
|
||||
|
||||
void Save(Writer & w) const;
|
||||
|
||||
|
@ -28,13 +28,13 @@ struct IngoingCrossNode
|
|||
|
||||
struct OutgoingCrossNode
|
||||
{
|
||||
uint32_t m_nodeId;
|
||||
m2::PointD m_point;
|
||||
uint32_t m_nodeId;
|
||||
unsigned char m_outgoingIndex;
|
||||
|
||||
OutgoingCrossNode() : m_nodeId(INVALID_CONTEXT_EDGE_NODE_ID), m_point(m2::PointD::Zero()), m_outgoingIndex(0) {}
|
||||
OutgoingCrossNode(uint32_t nodeId, size_t const index, m2::PointD const & point) : m_nodeId(nodeId),
|
||||
m_point(point),
|
||||
OutgoingCrossNode() : m_point(m2::PointD::Zero()), m_nodeId(INVALID_CONTEXT_EDGE_NODE_ID), m_outgoingIndex(0) {}
|
||||
OutgoingCrossNode(uint32_t nodeId, size_t const index, m2::PointD const & point) : m_point(point),
|
||||
m_nodeId(nodeId),
|
||||
m_outgoingIndex(static_cast<unsigned char>(index)){}
|
||||
|
||||
void Save(Writer & w) const;
|
||||
|
|
|
@ -28,7 +28,7 @@ UNIT_TEST(TestContextSerialization)
|
|||
auto ins = newContext.GetIngoingIterators();
|
||||
TEST_EQUAL(distance(ins.first,ins.second), 2, ());
|
||||
TEST_EQUAL(ins.first->m_nodeId, 1, ());
|
||||
TEST_EQUAL(((++ins.first)->m_nodeId), 2, ());
|
||||
TEST_EQUAL((++ins.first)->m_nodeId, 2, ());
|
||||
|
||||
auto outs = newContext.GetOutgoingIterators();
|
||||
TEST_EQUAL(distance(outs.first,outs.second), 2, ());
|
||||
|
|
Loading…
Add table
Reference in a new issue