Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

Hi,

We are working with the OSRM service to calculate a distance/duration matrix between source and destination points. However, our requirement is somewhat unique, as the sources and destinations do not need to represent precise coordinates.

Instead, we need the ability to define a radius for each source and destination, effectively creating areas rather than exact points. The OSRM service should then return the shortest distance and duration for each source-destination pair, where both the source and destination can be any coordinate within their respective areas.

Could you please confirm if this functionality is configurable via a Lua file, or if it requires a different branch or fork of OSRM? Any guidance or suggestions would be greatly appreciated.

Thank you for your assistance!

You must be logged in to vote

Replies: 1 comment · 2 replies

Comment options

The functionality doesn't exist. What I have seen people do is working with centroids for areas.

You must be logged in to vote
2 replies
@515orestis
Comment options

Thank you for your response! Could you please recommend a fork that implements this functionality or something similar? Alternatively, if there's a place where I could find guidance or resources on how to achieve this?

@DennisOSRM
Comment options

So, I thought about this a bit more. The main observation is that you can compute the minimum distance between two areas the following way.

Assume you know the coordinates where roads enter (or leave) an area. This gives you a set of locations per area. For two areas let's call them l and k. To compute the minimum distance you run a matrix computation between the (l+k)*(k+l) and look for the minimum value in quadrants 1 and 3 of the matrix, ie the distances between all l and k locations.

Then you need to repeat this for all pairs of areas which is the expensive part of it.

Hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.