Skip to content
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

[feat] Expose native OSRM and Valhalla APIs #87

Open
6 of 20 tasks
azarz opened this issue Aug 1, 2023 · 4 comments
Open
6 of 20 tasks

[feat] Expose native OSRM and Valhalla APIs #87

azarz opened this issue Aug 1, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@azarz
Copy link
Member

azarz commented Aug 1, 2023

Feature

Expose native OSRM and Valhalla APIs

Is your feature request related to a problem? Please describe.

I would like to develop a web-based application using the maplibre-gl framework, and use the IGN routing APIs. The routing plugins available use native OSRM and Valhalla APIs to work, and I'd want to use them out of the box (https://github.com/maplibre/maplibre-gl-directions and https://github.com/watergis/mapbox-gl-valhalla)

Describe the solution you'd like

I'd like to be able to use the native APIs of OSRM and Valhalla on a road2 service (specifically, the one served by IGN).
For example :

  • osrm : {baseRoad2Url}/simple/1.0.0/osrm/driving/13.388860,52.517037;13.385983,52.496891?steps=true
  • valhalla : {baseRoad2Url}/simple/1.0.0/valhalla/isochrone?json={"locations":[{"lat":-1.0825252603106321,"lon":35.47230915879868}],"costing":"pedestrian","contours":[{"time":10,"color":"0000ff"}],"polygons":true}

Other suggestion :

  • osrm : {baseRoad2Url}/osrm/driving/13.388860,52.517037;13.385983,52.496891?steps=true
  • valhalla : {baseRoad2Url}/valhalla/isochrone?json={"locations":[{"lat":-1.0825252603106321,"lon":35.47230915879868}],"costing":"pedestrian","contours":[{"time":10,"color":"0000ff"}],"polygons":true}

Tasks

  • Create an openAPI JSON for OSRM (documentation/apis)
    • Route URL
    • GetCap URL to make the link between resources and profile/optimization
  • Create an openAPI JSON for Valhalla (documentation/apis)
    • Iso URL
    • GetCap URL to make the link between resources and profile/optimization
  • Modify the configuration to add the new APIs (docker/config/service.json)
  • Create the directories src/js/apis/osrm/1.0.0 and src/js/apis/valhalla/1.0.0
  • For each directory, code the init.js, update.js and index.js
    • For the init.js : create the getcap
    • For the update.js : update the getcap
    • For the index.js : create the router which handle requests.
  • Add new properties inside the routeRequest class to handle osrm options
  • Add new properties inside the isoRequest class to handle valhalla options
  • Add an optional option object inside the computeRequest function to indicate that we want the raw response of the motor or create two new classes for each motor responses
  • Add unit and integration tests for any new classes or properties of existing ones
  • Add request tests (test/functional/request/cucumber/features)
  • Modify the default configuration and run configuration functional tests
  • Update documentation
  • Update changelog
@azarz azarz added the enhancement New feature or request label Aug 1, 2023
@lgrd
Copy link
Collaborator

lgrd commented Aug 16, 2023

Hello @azarz, I like this idea. I prefer the second option and I would add a version. Something like {baseRoadUrl}/osrm/{osrmVersion}/driving/.... Is that possible with your framework ?

And how could we handle resources ?

@azarz
Copy link
Member Author

azarz commented Aug 17, 2023

Yes this is possible, the plugin only needs the url before /driving for OSRM and before /isochrone for Valhalla, so it doesn't matter what's before those.
For the same reason, the resource should be before those parts of the urls, maybe something like :
{baseRoad2Url}/osrm/{osrmVersion}/{resource}/driving/13.388860,52.517037;13.385983,52.496891?steps=true
and
{baseRoad2Url}/valhalla/{resource}/isochrone?json={"locations":[{"lat":-1.0825252603106321,"lon":35.47230915879868}],"costing":"pedestrian","contours":[{"time":10,"color":"0000ff"}],"polygons":true}

@lgrd
Copy link
Collaborator

lgrd commented Aug 17, 2023

Perfect ! Let's do it !

@lgrd lgrd moved this to 2023 in Road2 Roadmap Sep 28, 2023
@lgrd lgrd moved this from 2023 to In Progress in Road2 Roadmap Sep 28, 2023
@lgrd
Copy link
Collaborator

lgrd commented Apr 25, 2024

Ok for OSRM. TODO for valhalla.

@lgrd lgrd unassigned lgrd and XavDmz Apr 25, 2024
@lgrd lgrd moved this from In Progress to 2024 in Road2 Roadmap Apr 25, 2024
@lgrd lgrd removed the status in Road2 Roadmap Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: No status
Development

No branches or pull requests

3 participants