Standard Routing

The standard routing API supports routing between two or more waypoints. It is designed to return the response covering indoor and outdoor routing scenarios such as indoor-to-indoor, outdoor-to-indoor, indoor-to-outdoor, or outdoor-to-outdoor routes.

  • Base URL : https://api.unl.global/{version}/routing

  • The routing APIs are powered by our patented cell routing technology for the indoor spaces.

Standard Routing Endpoints#

POST https://api.unl.global/v1/routing

Required Headers#

x-unl-vpm-id: Pass the unique Project Id also known as VPM Id under this parameter.

x-unl-api-key: Secure key to authorize the access to endpoints.

Request Parameters#

  • Mandatory Body Parameters

waypoints: It takes an array of Geohash, Coordinates objects to construct a route request for a minimum two or more waypoints sequences. In case two waypoints are given, it is considered as a single pair of origin and destination.

Objects can be defined using following combinations:

  • Object representing a geohash

    • type: It is an enum type with values are point, geohash, and indoor. It defines the type of waypoint with respect to a given object. In this case, type property should be set to geohash.

    • transportMode: It defines transport type for the route between one waypoint to another. It takes an array of an enum. The values are pedestrian, wheelchair, bicycle, car, carHOV, and truck.

    • geohash: It is a string-type property that takes geohash of the coordinates. It is used to identify world location with respect to encoding with the base 32 alphabet 0123456789bcdefghjklmnpqrstuvwxyz.

  • Object representing coordinates

    • type: It is an enum type with values are point, geohash, and indoor. It defines the type of waypoint with respect to a given object. In this case, type property should be set to point.

    • transportMode: It defines transport type for the route between one waypoint to another. It takes an array of an enum. The values are pedestrian, wheelchair, bicycle, car, carHOV, and truck.

    • coordinates: It is a string-type property that takes comma-separated coordinates in the form of longitude,latitude.

  • Optional Parameters

    • arriveBy: It is used for defining the arrival time in the outdoor routes. It takes time as string format. It can be either date-time or full-date or partial-time in RFC 3339. The requested time is converted to the local time at the destination. When the optional timezone offset is not specified, time is assumed to be local. If neither arriveBy nor departAt is specified, the current time at departure place will be used.

      • Example, 2019-06-24T01:23:45
    • departAt: It is used for defining departure time in the outdoor routes. It takes time as string format. It can be either date-time or full-date or partial-time in RFC 3339. When the optional timezone offset is not specified, time is assumed to be local.

      • Example, 2019-06-24T01:23:45
    • avoid: Avoid routes that violate certain features of the road network or that go through user-specified geographical bounding boxes. A bounding box area can be specified to avoid the region during the calculation. It takes the string form of minLat,minLon,maxLat,maxLon. avoid: "52.346791,4.865935,52.349780,4.866879"

    • preference: It is an enum type and values are fastest or shortest. It is used for creating the route with respect to the shortest distance or fastest route in terms of distance between origin and destination.

  • Sample Request Body

    {
    "preference": "fastest",
    "waypoints": [
    {
    "type": "point",
    "transportMode": "pedestrian",
    "geohash": "string"
    },
    {
    "type": "point",
    "transportMode": "pedestrian",
    "coordinates": "string"
    },
    {
    "type": "point",
    "transportMode": "pedestrian",
    "venueId": "string",
    "unitId": "string",
    "geohash": "string"
    }
    ]
    }

Response Parameters#

  • start: It specifies the origin which is the starting point of the multiple waypoints. It is in geohash format so one can use this geohash format to convert coordinates or other representation by using publicly available UNL core library or any other tool which is available on the Internet.

  • end: It specifies the destination point of the multiple waypoints.

  • segments: It specifies the sequence of connected segments in the route between each waypoint. It provides direction, speed limits, and travel information between specific waypoints.

    • point: It specifies a starting point on the map that the route passes through it.

    • length: It specifies the total distance between the preceding point and the successive segment’s starting point.

    • duration: It specifies the total elapsed time between the preceding point and the successive segment’s starting point.

    • maxHeight:

    • speedLimit: It specifies the maximum speed limit for the segment between waypoints.

    • speedLimitUnit: It indicates the unit of the measurement of the speed for the segment between waypoints. It takes kmph and mph.

    • roadName: It specifies the road name that the current segment is corresponding to.

    • instruction: It simplifies the navigation information with short enum values. It has several values such as continue, left, and right.

    • text: It specifies the instruction for the route. This is basically navigation information for the current segment.

    • transportMode: It specifies the transport mode for each segment. Note that this property will not be placed into this object and moved to the top of the request to provide a consistent transport mode on the map instead of overriding each segment to change the transport mode.

    • action: It specifies the action that has to be reacted to that information with instruction to tend correct direction on the route segment.

    • firstPoint: It specifies each segment starting index on the linestring object in order to extract part of the line segment or namely route by starting the first point up to the last point which is defined in each segment.

    • lastPoint: It specifies each segment finishing index on the linestring object. All the explanations are the same as in the firstPoint property.

  • overview: A single GeoJSON object that specifies route geometry and main properties of the route between each waypoint.

    • linestring: It defines the total route in the form of geohash array. Each element represents a point on the map. The linestring can be visualized easily on the map via some drawing tool.
  • Samples Response

    {
    "start": "u1ku1m5e9h",
    "end": "u1ku1m5e9h",
    "segments": [
    {
    "point": "u1ku1m5e9h",
    "length": 0,
    "duration": 0,
    "maxHeight": null,
    "speedLimit": null,
    "speedLimitUnit": null,
    "roadName": "",
    "instruction": "continue",
    "text": "Head <span class=\"heading\">north</span> on <span class=\"street\">Klenkerweg</span>.",
    "transportMode": "car",
    "action": "depart",
    "firstPoint": 0,
    "lastPoint": 1
    },
    {
    "point": "u1ku1m5e9h",
    "length": 0,
    "duration": 0,
    "maxHeight": null,
    "speedLimit": null,
    "speedLimitUnit": null,
    "roadName": "Klenkerweg",
    "instruction": "continue",
    "text": "Arrive at <span class=\"street\">Klenkerweg</span>.",
    "transportMode": "car",
    "action": "arrive",
    "firstPoint": 1,
    "lastPoint": 1
    }
    ],
    "overview": {
    "linestring": [
    "u1ku1m5e9hpb",
    "u1ku1m5e9hpb"
    ]
    }
    }

API Response Code

200 : HTTP ok - Request was successfully processed

201 : HTTP created - Bulk job successfully created

401 : HTTP unauthorized - User does not have permission to carry out this action