-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [doc] add osrm spec * [doc] add valhalla spec * WIP: adding OSRM native API. * WIP: OSRM native API: routing coordinates validation. * WIP: Request parameters implemented when they match routeRequest's parameters, and ignored when not. OSRM controller's writeRouteResponse is being implemnted, but it will need modifications of RouteResponse class. * WIP: implementing response writing for an OSRM native routing request. Slight edition of routeResponse and osrmSource classes to do so. * WIP: OSRM controller implemented, but unpolished and untested. TODO : * complete logging and varible check * test the code * OSRM routing request seems to work. TODO: * check result to see if every property is valid and exact. * adapt getcapabilities to OSRM API capabilities. * Fixed OSRM native response's waypoints, and intersections geometry format. * fix and tests * some littles changes and tests * [doc] update version to 2.2.5 --------- Co-authored-by: Loic <loic.grondin@ign.fr> Co-authored-by: Xav Dmz <XDmz@protonmail.com>
- Loading branch information
1 parent
1e9172b
commit a0c9483
Showing
17 changed files
with
1,485 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,6 +58,10 @@ | |
{ | ||
"name" : "simple", | ||
"version" : "1.0.0" | ||
}, | ||
{ | ||
"name" : "osrm", | ||
"version" : "1.0.0" | ||
} | ||
] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,262 @@ | ||
{ | ||
"openapi": "3.0.0", | ||
"info": { | ||
"description": "Description of the OSRM API available via Road2. Only route operation in its v1 is available.", | ||
"version": "1.0.0", | ||
"title": "OSRM API inside Road2", | ||
"contact": { | ||
"email": "contact.geoservices@ign.fr" | ||
} | ||
}, | ||
"servers": [ | ||
{ | ||
"url": "http://localhost:8080/osrm/1.0.0/", | ||
"description": "Local server" | ||
} | ||
], | ||
"tags": [ | ||
{ | ||
"name": "Discover", | ||
"description": "Discover the resources available on this instance." | ||
}, | ||
{ | ||
"name": "Route", | ||
"description": "Ask for one or multiple routes." | ||
} | ||
], | ||
"paths": { | ||
"/resources": { | ||
"get": { | ||
"tags": [ | ||
"Discover" | ||
], | ||
"summary": "Request used to discover the resources available on this instance.", | ||
"description": "", | ||
"operationId": "resources", | ||
"responses": { | ||
"200": { | ||
"description": "successful operation", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/resources" | ||
} | ||
} | ||
} | ||
}, | ||
"404": { | ||
"description": "Not found" | ||
} | ||
} | ||
} | ||
}, | ||
"/{resourceId}/{profileId}/{optimizationId}/route/v1/_/{coordinates}": { | ||
"get": { | ||
"tags": [ | ||
"Route" | ||
], | ||
"summary": "Compute a route", | ||
"description": "This API route is the same of [the OSRM v1 route](http://project-osrm.org/docs/v5.5.1/api/#route-service). But the profile parameter is separated in three parameters : resourceId, profileId and optimizationId. It allows us to have the concepts of Road2 and a better compatibility with the native OSRM API.", | ||
"operationId": "route", | ||
"parameters": [ | ||
{ | ||
"name": "resourceId", | ||
"in": "path", | ||
"description": "The resource used for the compute. The list of resources is available on /resources. A resource is a concept of Road2, it is an agregation of multiple graphs. For instance, an unique topology with multiple costs.", | ||
"required": true, | ||
"schema": { | ||
"type": "string" | ||
}, | ||
"example": "bdtopo-osrm" | ||
}, | ||
{ | ||
"name": "coordinates", | ||
"in": "path", | ||
"description": "String of format {longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...] or polyline({polyline}).", | ||
"required": true, | ||
"schema": { | ||
"type": "string" | ||
}, | ||
"example": "2.337306,48.849319" | ||
}, | ||
{ | ||
"name": "profileId", | ||
"in": "path", | ||
"description": "The profile used for the compute. The list of profiles per resource is available on /resources.", | ||
"required": true, | ||
"schema": { | ||
"type": "string" | ||
}, | ||
"example": "car" | ||
}, | ||
{ | ||
"name": "optimizationId", | ||
"in": "path", | ||
"description": "The optimization used for the compute. The list of optimizations per resource is available on /resources.", | ||
"required": true, | ||
"schema": { | ||
"type": "string" | ||
}, | ||
"example": "fastest" | ||
}, | ||
{ | ||
"name": "alternatives", | ||
"in": "query", | ||
"description": "Search for alternative routes and return as well. Please note that even if an alternative route is requested, a result cannot be guaranteed.", | ||
"required": false, | ||
"schema": { | ||
"type": "string" | ||
}, | ||
"example": "false" | ||
}, | ||
{ | ||
"name": "steps", | ||
"in": "query", | ||
"description": "Return route steps for each route leg.", | ||
"required": false, | ||
"schema": { | ||
"type": "string" | ||
}, | ||
"example": "false" | ||
}, | ||
{ | ||
"name": "annotations", | ||
"in": "query", | ||
"description": "Returns additional metadata for each coordinate along the route geometry.", | ||
"required": false, | ||
"schema": { | ||
"type": "string" | ||
}, | ||
"example": "false" | ||
}, | ||
{ | ||
"name": "geometries", | ||
"in": "query", | ||
"description": "Returned route geometry format (influences overview and per step). Values can be : polyline (default), polyline6 , geojson.", | ||
"required": false, | ||
"schema": { | ||
"type": "string" | ||
}, | ||
"example": "polyline" | ||
}, | ||
{ | ||
"name": "overview", | ||
"in": "query", | ||
"description": "Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all. Values can be : simplified (default), full , false.", | ||
"required": false, | ||
"schema": { | ||
"type": "string" | ||
}, | ||
"example": "simplified" | ||
}, | ||
{ | ||
"name": "continue_straight", | ||
"in": "query", | ||
"description": "Forces the route to keep going straight at waypoints constraining uturns there even if it would be faster. Default value depends on the profile. Values can be : default (default), true , false. ", | ||
"required": false, | ||
"schema": { | ||
"type": "string" | ||
}, | ||
"example": "default" | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "Successful operation. For all the details, see [the OSRM documentation](http://project-osrm.org/docs/v5.5.1/api/#route-service).", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/osrmValidResponse" | ||
} | ||
} | ||
} | ||
}, | ||
"400": { | ||
"description": "Error. For all the details, see [the OSRM documentation](http://project-osrm.org/docs/v5.5.1/api/#route-service).", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/osrmErrorResponse" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"components": { | ||
"schemas": { | ||
"osrmErrorResponse": { | ||
"type": "object", | ||
"properties": { | ||
"code": { | ||
"type": "string" | ||
}, | ||
"message": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"osrmValidResponse": { | ||
"type": "object", | ||
"properties": { | ||
"code": { | ||
"type": "string", | ||
"description" : "if the request was successful Ok otherwise see the service dependent and general status codes on the [the OSRM documentation](http://project-osrm.org/docs/v5.5.1/api/#route-service)." | ||
}, | ||
"routes": { | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"description": "For all the details, see the OSRM documentation of a [route object](http://project-osrm.org/docs/v5.5.1/api/#route-object)." | ||
} | ||
}, | ||
"waypoints": { | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"description": "For all the details, see the OSRM documentation of a [waypoint object](http://project-osrm.org/docs/v5.5.1/api/#waypoint-object)." | ||
} | ||
} | ||
} | ||
}, | ||
"resources": { | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"properties": { | ||
"id": { | ||
"type": "string" | ||
}, | ||
"description": { | ||
"type": "string" | ||
}, | ||
"profiles": { | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"properties": { | ||
"id": { | ||
"type": "string" | ||
}, | ||
"optimizations": { | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"properties": { | ||
"id": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.