Routing

specdraftimplproposal

Calculate and manage routes.

Scope

This building block computes routes using a routing provider; that is, am PostgreSQL feature provider with the extensions PostGIS and pgRouting.

An option to store and manage routes that have been computed can be enabled, too.

Conformance Classes

Routing implements the conformance classes "Core", "Manage Routes", "Modes", "Intermediate Waypoints", "Height Restrictions", "Weight Restrictions", and "Obstacles" of the draft OGC API - Routes - Part 1: Coreopen in new window and the conformance class "Route Exchange Model" of the draft OGC Route Exchange Modelopen in new window.

Operations

ResourcePathMethodsMedia TypesDescription
Route Definition
routes/{routeId}/definition
GET
JSON
Fetch the definition of a stored route.
Route
routes/{routeId}
DELETE
Delete a stored route.
Route
routes/{routeId}
GET
GeoJSON
Fetches a route.
Routes
routes
GET
HTML, JSON
Fetches the list of stored routes.
Route
routes
POST
GeoJSON
This operation creates a new route. The payload of the request specifies the definition of the new route.

Path Parameters

NameResourcesDescription
routeId
Route, Route Definition
The local identifier of the route.

Query Parameters

NameResourcesDescription
f
Routes
Select the output format of the response. If no value is provided, the standard HTTP rules apply, i.e., the "Accept" header will be used to determine the format.
f
Route
Select the output format of the response. If no value is provided, the standard HTTP rules apply, i.e., the "Accept" header will be used to determine the format.
f
Route Definition
Select the output format of the response. If no value is provided, the standard HTTP rules apply, i.e., the "Accept" header will be used to determine the format.
crs
Routes
The coordinate reference system of the returned features. Default is WGS84 longitude/latitude (with or without ellipsoidal height).

Configuration

Options

NameDefaultDescriptionTypeSince
buildingBlock
Always ROUTING.
string
v3.1
enabled
false
Enable the building block?
boolean
v3.1
caching
{}
Sets fixed values for HTTP Caching Headers for the resources.
object
v3.1
featureType
null
Required Name of the feature type in the feature provider with the routing extension that provides the route feature as a series of route segments. See Routing Provider for configuring the
string
v3.1
manageRoutes
false
Enables support for conformance class Manage Routes. If enabled, routes along with their request payload are stored in the API and can be retrieved. Routes that are no longer needed can be deleted.
boolean
v3.1
intermediateWaypoints
false
Enables support for conformance class Intermediate Waypoints. If enabled, routing requests can provide more than two waypoints along the route.
boolean
v3.1
weightRestrictions
false
Enables support for conformance class Weight Restrictions. If enabled, routing requests can include the weight of the vehicle and route segments will only be selected, if they support the weight.
boolean
v3.1
heightRestrictions
false
Enables support for conformance class Height Restrictions. If enabled, routing requests can include the height of the vehicle and route segments will only be selected, if they support the weight.
boolean
v3.1
obstacles
false
Enables support for conformance class Obstacles. If enabled, routing requests can include a multi-polygon of areas that the route must avoid.
boolean
v3.1
speedLimitUnit
kmph
Sets the unit used in speed limit attributes of segments. Either "kmph" or "mph".
string
v3.1
defaultPreference
fastest
Sets the default value for the "preference" (cost function) in the routing request.
string
v3.1
defaultMode
driving
Sets the default value for the "mode" (mode of transport) in the routing request.
string
v3.1
additionalFlags
{}
The routing provider supports passing additional flags (key-value-pairs) that can be taken into account in the routing process.
object
v3.1
defaultCrs
CRS84
Default coordinate reference system, either CRS84 for routing providers with 2D coordinates, CRS84h for 3D coordinates.
string
v3.1
coordinatePrecision
{}
Controls whether coordinates are limited to a certain number of places depending on the coordinate reference system used. The unit of measurement and the corresponding number of decimal places must be specified. Example: { "metre" : 2, "degree" : 7 }. Valid units of measurement are "metre" and "degree".
object
v3.1
elevationProfileSimplificationTolerance
null
If set, route segment geometries with 3D coordinates will be smoothened using the Douglas-Peucker algorithm with the specified tolerance.
number
v3.1
html
{ "enabled": true }
If enabled (the object includes a "enabled" member set to true), the HTML response to the Get Routes operation will be enabled. The object can also include a "defaults" member that contains key-value pairs. The following properties are supported: "name" (default name of the route), "start" (longitude and latitude of the default start of the route), "end" (longitude and latitude of the default end of the route), "center" (longitude and latitude of the center point of the initial map view), "centerLevel" (WebMercatorQuad zoom level of the initial map view).
object
v3.1

Examples


- buildingBlock: ROUTING
  enabled: true
  featureType: route
  defaultCrs: CRS84
  coordinatePrecision:
    metre: 2
    degree: 7
  defaultPreference: fastest
  defaultMode: driving
  speedLimitUnit: kmph
  intermediateWaypoints: true
  weightRestrictions: true
  heightRestrictions: true
  obstacles: true
  manageRoutes: true
  html:
    enabled: true
    crs:
      'WGS 84 longitude/latitude':
        code: 4326
        forceAxisOrder: LON_LAT
      'Web Mercator':
        code: 3857
        forceAxisOrder: NONE
    defaults:
      name: Calexico International Airport to Shafter Airport
      start:
      - -115.510
      - 32.667
      end:
      - -119.184
      - 35.505
      center:
      - -118.0
      - 34.5
      centerLevel: 6