Initial libosrm API docs

This commit is contained in:
Daniel J. Hofmann
2016-04-01 17:23:41 +02:00
committed by Patrick Niklaus
parent 9b52dd8bf7
commit c6c25e609b
13 changed files with 293 additions and 9 deletions
+16
View File
@@ -43,6 +43,22 @@ namespace engine
{
namespace api
{
/**
* General parameters for OSRM service queries.
*
* Holds member attributes:
* - coordinates: for specifying location(s) to services
* - hints: hint for the service to derive the position(s) in the road network more efficiently,
* optional per coordinate
* - radiuses: limits the search for segments in the road network to given radius(es) in meter,
* optional per coordinate
* - bearings: limits the search for segments in the road network to given bearing(s) in degree
* towards true north in clockwise direction, optional per coordinate
*
* \see OSRM, Coordinate, Hint, Bearing, RouteParame, RouteParameters, TableParameters,
* NearestParameters, TripParameters, MatchParameters and TileParameters
*/
struct BaseParameters
{
std::vector<util::Coordinate> coordinates;
+9
View File
@@ -39,6 +39,15 @@ namespace engine
namespace api
{
/**
* Parameters specific to the OSRM Match service.
*
* Holds member attributes:
* - timestamps: timestamp(s) for the corresponding input coordinate(s)
*
* \see OSRM, Coordinate, Hint, Bearing, RouteParame, RouteParameters, TableParameters,
* NearestParameters, TripParameters, MatchParameters and TileParameters
*/
struct MatchParameters : public RouteParameters
{
MatchParameters()
@@ -37,6 +37,15 @@ namespace engine
namespace api
{
/**
* Parameters specific to the OSRM Nearest service.
*
* Holds member attributes:
* - number of results: number of nearest segments that should be returned
*
* \see OSRM, Coordinate, Hint, Bearing, RouteParame, RouteParameters, TableParameters,
* NearestParameters, TripParameters, MatchParameters and TileParameters
*/
struct NearestParameters : public BaseParameters
{
unsigned number_of_results = 1;
+15 -4
View File
@@ -39,6 +39,20 @@ namespace engine
namespace api
{
/**
* Parameters specific to the OSRM Route service.
*
* Holds member attributes:
* - steps: return route step for each route leg
* - alternatives: tries to find alternative routes
* - geometries: route geometry encoded in Polyline or GeoJSON
* - overview: adds overview geometry either Full, Simplified (according to highest zoom level) or
* False (not at all)
* - uturns: enable or disable uturns (disabled by default)
*
* \see OSRM, Coordinate, Hint, Bearing, RouteParame, RouteParameters, TableParameters,
* NearestParameters, TripParameters, MatchParameters and TileParameters
*/
struct RouteParameters : public BaseParameters
{
enum class GeometriesType
@@ -73,10 +87,7 @@ struct RouteParameters : public BaseParameters
OverviewType overview = OverviewType::Simplified;
boost::optional<bool> uturns;
bool IsValid() const
{
return coordinates.size() >= 2 && BaseParameters::IsValid();
}
bool IsValid() const { return coordinates.size() >= 2 && BaseParameters::IsValid(); }
};
}
}
+12
View File
@@ -43,6 +43,18 @@ namespace engine
namespace api
{
/**
* Parameters specific to the OSRM Table service.
*
* Holds member attributes:
* - sources: indices into coordinates indicating sources for the Table service, no sources means
* use all coordinates as sources
* - destinations: indices into coordinates indicating destinations for the Table service, no
* destinations means use all coordinates as destinations
*
* \see OSRM, Coordinate, Hint, Bearing, RouteParame, RouteParameters, TableParameters,
* NearestParameters, TripParameters, MatchParameters and TileParameters
*/
struct TableParameters : public BaseParameters
{
std::vector<std::size_t> sources;
+15
View File
@@ -37,6 +37,21 @@ namespace engine
namespace api
{
/**
* Parameters specific to the OSRM Tile service.
*
* Holds member attributes:
* - x: the x location for the tile
* - y: the y location for the tile
* - z: the zoom level for the tile
*
* The parameters x,y and z have to conform to the Slippy Map Tilenames specification:
* - https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames#Zoom_levels
* - https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames#X_and_Y
*
* \see OSRM, Coordinate, Hint, Bearing, RouteParame, RouteParameters, TableParameters,
* NearestParameters, TripParameters, MatchParameters and TileParameters
*/
struct TileParameters final
{
unsigned x;
+6
View File
@@ -39,6 +39,12 @@ namespace engine
namespace api
{
/**
* Parameters specific to the OSRM Trip service.
*
* \see OSRM, Coordinate, Hint, Bearing, RouteParame, RouteParameters, TableParameters,
* NearestParameters, TripParameters, MatchParameters and TileParameters
*/
struct TripParameters : public RouteParameters
{
// bool IsValid() const; Falls back to base class