Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Capping Distance/Time or just returing K Nearest Points in Table Service #3963

Closed
jamaps opened this issue Apr 20, 2017 · 3 comments
Closed

Comments

@jamaps
Copy link

jamaps commented Apr 20, 2017

Greetings OSRM,

I'm setting up OSRM to compute several large OD matrices (each ~ 15,000 x 15,000) for a large portion of southern Ontario.

I was wondering if there's a way to limit the size of the search e.g. only return points and durations that are less than a certain distance or time threshold - or only return the closest k number of points. I only need to analyze travel times for nearby points, not those on opposite sides of my map. Plus I would like to save some computation time if possible.

I did some searching but couldn't find anything. Apologies if this has been answered elsewhere.

Cheers,

  • JA
@daniel-j-h
Copy link
Member

Your description sounds suspiciously like isochrones? There is an experimental pull request: #3652

There is no option for stopping a Table request "early" on in the API.

For matrices this large you can also try

  • Use the node bindings or even libosrm directly (avoid http if you can)
  • Save results more efficiently than in json format
  • Decompose a single big request into smaller ones (run in parallel) and re-assemble them again; might come with some coordinate to internal data structure overhead, so keep the smaller matrices still as big as possible

@danpat
Copy link
Member

danpat commented Apr 20, 2017

To add to this - you can use the sources and destinations option on the table plugin to perform a 1:N query - generate coordinates in a radius around your centerpoint, and gradually repeat queries with a growing radius until you have no more coordinates within range.

Other than that, the table service isn't really intended for this. There are a couple of work-in-progress PR's for true isochrone searches #3652 #2477 and sort of #3903, but none are in the main codebase yet and all need some work.

@jamaps
Copy link
Author

jamaps commented Apr 20, 2017

Thanks guys! I've decided to divide and conquer in parallel which seems to do the trick faster than anticipated.

@jamaps jamaps closed this as completed Apr 20, 2017
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants