TrueWay Directions

GRATIS CON POSSIBILITร€ DI UPGRADE
Verified
โœ“
Da TrueWay Team | Aggiornamento 5์ผ ์ „ | Mapping
Popolaritร 

9.7 / 10

Latenza

387ms

Livello di servizio

100%

Health Check

N/A

README

Features and capabilities:

  • Global road network coverage.
  • Find the best route between two or more locations.
  • Optimize routes.
  • Use both historical traffic conditions and live traffic.
  • Can avoid toll roads, highways or ferries.
  • Return distance and duration information.
  • Return route geometry.
  • Return multi-part directions using a series of stops.
  • Return turn-by-turn information.

Finding optimal route to visit several locations (FindDrivingRoute)

Required parameters:

  • stops - Specify two or more semicolon-delimited locations(Lat/Lng) between which the route is to be found. Max: 25.

Optional parameters:

  • avoid_highways - The route should avoid highways.
  • avoid_tolls - The route should avoid toll roads.
  • avoid_ferries - The route should avoid ferries.
  • avoid_highways - The route should avoid highways.
  • geometry_format - The format of the returned route geometry: latlng, lnglat or geojson.
  • optimize - Instructs the API to reorder stops to find the optimized route. The route first stop and last stop order is not changed, their position is considered fixed.

Finding optimal route from a origin to a destination (FindDrivingPath)

Required parameters:

  • origin - The location from which you wish to calculate directions.
  • destination - The location to which you wish to calculate directions.

Optional parameters:

  • avoid_highways - The route should avoid highways.
  • avoid_tolls - The route should avoid toll roads.
  • avoid_ferries - The route should avoid ferries.
  • avoid_highways - The route should avoid highways.
  • geometry_format - The format of the returned route geometry: latlng, lnglat or geojson.
  • waypoints - Specifies an array of intermediate locations to include along the route between the origin and destination points as pass through locations. Max: 23.
  • start_time - Time when travel is expected to start. This time is used to take into account traffic conditions (for paid plans only). You can specify the time as an integer in seconds since midnight, January 1, 1970 UTC or you can use โ€œnowโ€ to specify the current time.

The main difference between FindDrivingRoute and FindDrivingPath is that FindDrivingRoute is optimized for a route with multiple stops and can optimize the route (reorder stops) with parameter optimize=true. FindDrivingPath does not change the order of visiting points, but is optimized for a route between two points. Also FindDrivingPath can take traffic conditions into account (for paid plans only).

Response

The service returns a optimal route with detailed information:

  • distance (length of route)
  • duration (time of route)
  • route geometry
  • bounds of route geometry
  • turn-by-turn directions

A Route contains the following fields:

  • distance contains the length of route (meters).
  • duration contains the time of route (seconds).
  • geometry contains the geometry of route. By default, geometry contains a single coordinates object, which is a two-dimensional array of points (Latitude/Longitude).
  • bounds contains the bounds of geometry.
  • legs contains an array which contains information about a leg of the route, between two locations within the route. A route with no intermediate waypoints will contain exactly one leg within the legs array. Each leg consists of a series of steps.

A Leg contains the following fields:

  • distance contains the length of leg (meters).
  • duration contains the time of leg (seconds).
  • start_point_index contains the index of point (within geometry.coordinates array) at which the leg starts.
  • start_point contains the coordinate of point (within geometry.coordinates array) at which the leg starts.
  • end_point_index contains the index of point (within geometry.coordinates array) at which the leg ends.
  • end_point contains the coordinate of point (within geometry.coordinates array) at which the leg ends.
  • bounds contains the bounds of leg geometry.
  • steps contains an array which contains information about a step of the leg.

A Step contains the following fields:

  • distance contains the length of step (meters).
  • duration contains the time of step (seconds).
  • start_point_index contains the index of point (within geometry.coordinates array) at which the step starts.
  • start_point contains the coordinate of point (within geometry.coordinates array) at which the step starts.
  • end_point_index contains the index of point (within geometry.coordinates array) at which the step ends.
  • end_point contains the coordinate of point (within geometry.coordinates array) at which the step ends.
  • bounds contains the bounds of step geometry.
  • maneuver contains the action to take for the step (โ€œturn leftโ€, โ€œturn rightโ€, etc.).

Please note that for FindDrivingPath, the route does not contain the field legs but directly contains the field steps.

FindDrivingRoute Response Example:

{
  "route":{
    "distance":10148
    "duration":2629
    "bounds":{
      "south":40.618996
      "west":-74.025801
      "north":40.645331
      "east":-73.98078
    }
    "geometry":{
      "coordinates":
        [
          0:[
            0:40.629103
            1:-74.025801
          ]
          1:[
            0:40.629409
            1:-74.025679
          ]
          2:[
            0:40.630117
            1:-74.025375
          ]
          ...
        ]
    }
    "legs":[
      0:{
        "distance":3919
        "duration":834
        "start_point_index":0
        "start_point":{
          "lat":40.629103
          "lng":-74.025801
        }
        "end_point_index":112
        "end_point":{
          "lat":40.630157
          "lng":-73.993608
        }
        "bounds":{...}
        "steps":[
          0:{
            "distance":199
            "duration":40
            "start_point_index":0
            "start_point":{...}
            "end_point_index":5
            "end_point":{...}
            "bounds":{...}
          }
          1:{
            "distance":2137
            "duration":396
            "start_point_index":5
            "start_point":{...}
            "end_point_index":70
            "end_point":{...}
            "bounds":{...}
            "maneuver":"turn right"
          }
          2:{...}
        ]
      }
      1:{...}
      2:{...}
    ]
  }
}

FindDrivingPath Response Example:

{
  "route":{
    "distance":5401
    "duration":1099
    "bounds":{
      "south":40.614813
      "west":-74.025801
      "north":40.630814
      "east":-73.98078
    }
    "geometry":{
      "coordinates":
      [
        0:[
          0:40.629103
          1:-74.025801
        ]
        1:[
          0:40.629409
          1:-74.025679
        ]
        2:[
          0:40.630117
          1:-74.025375
        ]
        ...
      ]
    }
    "steps":[
      0:{
        "distance":199
        "duration":40
        "start_point_index":0
        "start_point":{
          "lat":40.629103
          "lng":-74.025801
        }
        "end_point_index":5
        "end_point":{
          "lat":40.630804
          "lng":-74.025081
        }
        "bounds":{...}
      }
      1:{
        "distance":2879
        "duration":524
        "start_point_index":5
        "start_point":{...}
        "end_point_index":78
        "end_point":{...}
        "bounds":{...}
        "maneuver":"turn right"
      }
      2:{...}
      3:{...}
    ]
  }
}
Follower: 8
Risorse:
Sito web del prodotto
Creatore dell'API:
Rapid account: True Way Team
TrueWay Team
trueway
Accedi per valutare l'API
Valutazione: 5 - Voti: 1