Closed TakuHum closed 2 months ago
@TakuHum For completely different profiles, you will need more than the .osrm
file - it's possible that different profiles will include/exclude different parts of the map, so the .geometry
and all other files would be different between profiles too.
Ultimately, the confusion here is about osrm-routed
. Instead of making large complicated changes to how OSRM stores data in files, I suggest it would be significantly simpler to use a HTTP reverse proxy running in front of several osrm-routed
backends, and map requests through to the appropriate backend based on the URL path.
There's an example nginx
configuration in https://github.com/Project-OSRM/osrm-backend/issues/4517#issuecomment-330359238 that does exactly this.
@danpat
Thanks.
Somehow I understood that it is difficult. We will consider including using a reverse proxy.
@danpat
We are considering proceeding with the reverse proxy as recommended by you. However, we would like to consider the method of the title as an alternative.
Which part of the source code has been published for osrm-extract, osrm-contract, and osrm-routing? If it is not released, is it possible to get it?
Is the programming language C++?
Best regards,
@TakuHum All the source code for OSRM resides in this GitHub repository. Click on the "Code" link on the top-left.
I do not think embedding multiple profiles within a single OSRM file is a good idea. It will be quite a complicated change, and won't achieve anything that you could do by instantiating multiple separate OSRM threads/workers/processes. Ultimately, there would be very little shared data between different profiles, so you'd effectively be generating multiple .osrm
files anyway.
If you take a look at https://github.com/Project-OSRM/osrm-backend/blob/master/example/example.cpp, you will see how to query OSRM using the C++ library interface. It's quite simple to instantiate multiple OSRM
objects within a single program, each one pointing at different data files. The same can be done in NodeJS using the Node bindings we supply, or at the HTTP level by using a reverse HTTP proxy like nginx
. Any of these options would be significantly simpler than making OSRM capable of embedding multiple data profiles within the same fileset.
This issue seems to be stale. It will be closed in 30 days if no further activity occurs.
Hi!
We consider to implement to support routing the different types of route with different profiles of API from a same map.osrm file.
It seems to be technically feasible (https://github.com/Project-OSRM/osrm-backend/issues/5436).
We have two questions to implement the feature. I’m looking forward to hearing from you soon.
Would you tell me the files or folders or classes to be changed involved to achieve the above?
We want to understand the structure of map.osrm file. Are there any specifications? Is it possible to change the structure?
Best regards,