Files
services/routing/proto/routing.proto
2021-09-02 15:23:24 +01:00

111 lines
2.7 KiB
Protocol Buffer

syntax = "proto3";
package routing;
option go_package = "./proto;routing";
service Routing {
// Route returns a gps route from origin to destination based on lat/lng
rpc Route(RouteRequest) returns (RouteResponse) {}
// Eta returns an estimated time of arrival for a route
rpc Eta(EtaRequest) returns (EtaResponse) {}
// Directions provides turn by turn directions
rpc Directions(DirectionsRequest) returns (DirectionsResponse) {}
}
message Point {
// Lat e.g 52.523219
double latitude = 1;
// Long e.g 13.428555
double longitude = 2;
}
message Waypoint {
// street name or related reference
string name = 1;
// gps point coordinates
Point location = 2;
}
message Maneuver {
double bearing_before = 1;
double bearing_after = 2;
Point location = 3;
string action = 4;
string direction = 5;
}
message Intersection {
Point location = 1;
repeated double bearings = 2;
}
message Direction {
// street name or location
string name = 1;
// alternative reference
string reference = 2;
// human readable instruction
string instruction = 3;
// distance to travel in meters
double distance = 4;
// duration to travel in seconds
double duration = 5;
// maneuver to take
Maneuver maneuver = 6;
// intersections on route
repeated Intersection intersections = 7;
}
// Turn by turn directions from a start point to an end point including maneuvers and bearings
message DirectionsRequest {
// The staring point for the journey
Point origin = 1;
// The destination of the journey
Point destination = 2;
}
message DirectionsResponse {
// Turn by turn directions
repeated Direction directions = 1;
// The waypoints on the route
repeated Waypoint waypoints = 2;
// Estimated distance of the route in meters
double distance = 3;
// Estimated duration of the route in seconds
double duration = 4;
}
// Get the eta for a route from origin to destination. The eta is an estimated time based on car routes
message EtaRequest {
// The starting point for the eta calculation
Point origin = 1;
// The end point for the eta calculation
Point destination = 2;
// type of transport. Only "car" is supported currently.
string type = 3;
// speed in kilometers
double speed = 4;
}
message EtaResponse {
// eta in seconds
double duration = 1;
}
// Retrieve a route as a simple list of gps points along with total distance and estimated duration
message RouteRequest {
// Point of origin for the trip
Point origin = 1;
// Point of destination for the trip
Point destination = 2;
}
message RouteResponse {
// estimated distance in meters
double distance = 1;
// estimated duration in seconds
double duration = 2;
// waypoints on the route
repeated Waypoint waypoints = 3;
}