-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[3party] Restoring the server-side OSRM plugin. #14170
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
To build the Mapsme plugin for osrm-backend: | ||
============================================ | ||
|
||
0. Build the regular omim project in the directory ${OMIM_BUILD_PATH}. | ||
|
||
1. Ignore all cmake files except those in omim/3party/osrm/osrm-backend, i.e. | ||
run | ||
|
||
> cd osrm-backend-build | ||
> cmake ${OMIM_ROOT}/3party/osrm/osrm-backend/ -DOMIM_BUILD_PATH=${OMIM_BUILD_PATH} | ||
|
||
2. Build the usual OSRM tools. | ||
|
||
> make -k -j4 osrm-extract osrm-prepare osrm-routed | ||
|
||
3. Run the OSRM pipeline on an *.osm.pbf file, see project OSRM docs or use | ||
omim/tools/unix/generate_planet_routing.sh to do it automatically. | ||
|
||
4. Run the routing daemon (osrm-routed). | ||
|
||
5. The mapsme API that current version of the repository expects is | ||
|
||
GET /{service}?loc={latlon1}&loc={latlon2} | ||
|
||
where {latlon1} and {latlon2} are {coordinates} of source and destination points, respectively, in the usual OSRM format. | ||
|
||
For example, if osrm-routed runs on localhost on the default port 5000, use | ||
|
||
> curl "http://127.0.0.1:5000/mapsme?loc=55,37&loc=55,40" | ||
|
||
The expected response is (note the omim-mercator coordinates) | ||
{"used_mwms":[[36.140419,60.524949,"Russia_Kursk Oblast"],[37.872379,67.58203,"Russia_Moscow Oblast_East"],[37.557854,67.355247,"Russia_Moscow"]]} | ||
|
||
|
||
|
||
|
||
LUABIND | ||
======= | ||
|
||
If you youse luabind library with a version lesser than 0.9.2, | ||
you may have troubles compiling OSRM code with a boost >=1.57 | ||
(more details here: https://github.com/luabind/luabind/issues/27 ). | ||
|
||
You can fix it either by using latest luabind from source https://github.com/rpavlik/luabind | ||
or https://github.com/DennisOSRM/luabind, or by applying the following patch | ||
to /usr/include/luabind/object.hpp: | ||
https://github.com/alex85k/luabind/commit/2340928e00f4d606255dd5d570e1e142353a5fdd | ||
|
||
|
||
On macOS, luabind is no longer supported by Homebrew so you may need to | ||
|
||
> brew edit luabind | ||
|
||
and comment out the "disable!" line. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,8 @@ | |
#include "../server/data_structures/internal_datafacade.hpp" | ||
|
||
#include <iostream> | ||
#include <utility> | ||
#include <vector> | ||
|
||
#include "../../../../base/bits.hpp" | ||
#include "../../../../base/logging.hpp" | ||
|
@@ -18,6 +20,17 @@ | |
#include "../../../succinct/rs_bit_vector.hpp" | ||
#include "../../../succinct/mapper.hpp" | ||
|
||
#define ROUTING_MATRIX_FILE_TAG "mercedes" | ||
#define ROUTING_EDGEDATA_FILE_TAG "daewoo" | ||
#define ROUTING_EDGEID_FILE_TAG "infinity" | ||
#define ROUTING_SHORTCUTS_FILE_TAG "skoda" | ||
#define ROUTING_CROSS_CONTEXT_TAG "chrysler" | ||
|
||
#define ROUTING_FTSEG_FILE_TAG "ftseg" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. не используется There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. поэтому и драфт эта версия уже рабочая, но я ещё доделываю There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. понятно, спасибо |
||
#define ROUTING_NODEIND_TO_FTSEGIND_FILE_TAG "node2ftseg" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. тоже не используется эти define ещё нужны? |
||
|
||
using namespace std; | ||
|
||
namespace | ||
{ | ||
template <typename T> | ||
|
@@ -74,8 +87,6 @@ string EdgeDataToString(EdgeOsrmT const & d) | |
return ss.str(); | ||
} | ||
|
||
|
||
|
||
void GenerateRoutingIndex(const std::string & fPath) | ||
{ | ||
ServerPaths server_paths; | ||
|
@@ -274,7 +285,7 @@ void GenerateRoutingIndex(const std::string & fPath) | |
container.Open(path); | ||
typedef routing::OsrmDataFacade<QueryEdge::EdgeData> DataFacadeT; | ||
DataFacadeT facadeNew; | ||
facadeNew.Load(container); | ||
// facadeNew.Load(container); | ||
|
||
uint64_t edgesCount = facadeNew.GetNumberOfEdges() - copiedEdges + ignoredEdges; | ||
std::cout << "Check node count " << facade.GetNumberOfNodes() << " == " << facadeNew.GetNumberOfNodes() << "..." << std::endl; | ||
|
@@ -403,5 +414,4 @@ void GenerateRoutingIndex(const std::string & fPath) | |
} | ||
PrintStatus(!error); | ||
} | ||
|
||
} | ||
} // namespace mapsme |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,8 +6,5 @@ | |
|
||
namespace mapsme | ||
{ | ||
|
||
|
||
void GenerateRoutingIndex(const std::string & fPath); | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
это такой вариант обфускации? это ещё нужно или можно назвать routing_matrix и так далее?