Distance API FAQ
这篇文档目前尚未提供译文,将以原文展示。
Q1. What is distance matrix API?
Distance matrix API computes travel, time and distance for a combination of origins and destinations. The API outputs a matrix that consists of rows and columns containing the distance and duration of each origin and destination pair.
Q2. How many origins and destinations can be passed into a distance matrix API request?
NextBillion.ai’s single-distance matrix API request can handle a matrix size of up to 5000 x 5000 origins and destinations. 1000 x 1000 is available by default. Higher matrix sizes can be provisioned upon request
Q3. How is NextBillion.ai’s Distance Matrix API different from that of Google or Mapbox?
While Google or Mapbox Distance Matrix API supports a matrix size of 25*25, NextBillion.ai’s Distance Matrix API supports a matrix size of 5000*5000 - a standout feature amongst existing players. Secondly, our pricing is very aggressive and is almost about 40% lower comparatively. Third, it is highly customizable based on the vehicle type, hence providing highly accurate and realistic ETAs. And we offer dedicated support, a rare service many mapping players don't provide.
Q4. What is the ETA accuracy that NextBillion.ai’s Distance Matrix API provides?
The Distance Matrix API customises ETAs based on the vehicle type - e.g. a truck, car,. It also takes into account other important data points and generates realistic and accurate ETAs that reflect real-time conditions and are very close to ground truth.
Q5. What customizations are possible on the Distance Matrix API?
The API uses AI-ML algorithms to power the customizations. It uses a combination of both first-party and third-party data such as vehicle type, trip data, routing preferences, speed profiles, live traffic, regional restrictions, etc to generate accurate and realistic ETAs.
Q6. Do you have/integrate live traffic for the ETA predictions?
Yes, we have live traffic data integrated into the ETA calculation. It might not be available for some geographies. It is available on request and some integration time/effort is needed.
Q7. How do you compare yourself with Google/Mapbox or other players in terms of performance?
In terms of performance, NextBillion.ai’s Distance Matrix API provides 10x- 20x higher throughput and 2x-3x lower latency. Our API is enterprise-grade in terms of reliability and availability. It has an uptime of more than 99%.
Q8. What does the integration process look like?
NextBillion.ai’s Distance Matrix API practically follows industry standard protocols. It is designed for developers and can be easily integrated into any application with a few lines of code. It is just a drop-in replacement for your existing API and you can easily switch and migrate.
Q9. How can I deploy the distance matrix API?
Ans: We are highly flexible and deliver both on-premise and cloud-agnostic deployment solutions. Our on-premise deployment enables 2-3x lower latency and 10-20x higher throughput. Our APIs are not tied to any specific cloud platform. You can deploy our APIs in any cloud of your choice and run them efficiently.
Q10. What is the difference between standard and flexible NextBillion.ai’s Distance Matrix API?
Ans: Standard and flexible are two different versions of the NextBillion.ai Distance Matrix API. They both use two different engines for returning navigation results. If the ‘options’ parameter is set to ‘flexible’, the request will be routed to flexible endpoints. If the ‘options’ parameter is not set the request will go to standard endpoints.
If the request goes to standard APIs, all the parameters (flexible) will not be considered for routing. When the request goes to flexible APIs, the standard parameters will not be considered.
If the request goes to standard APIs, all the parameters (flexible) will not be considered for routing. When the request goes to flexible APIs, the standard parameters will not be considered.
Q11. What are flexible-only parameters w.r.t. NextBillion.ai’s Distance Matrix API?
Ans: In terms of benefits to the users/customers, the Flexible version has some unique features that are not available in Standard , such as:
Time-dependent routing:
Time-dependent routing:
Route type:
With flexible mode, the results are based on the selected departure time and traffic conditions at a particular time.
One use case for Flexible DM - Employee transportation where shuttles need to be planned in advance for specific time slots during the route optimization process. Another example is the advanced ride booking on services like Ola or Uber, where the time-dependent API is used to provide accurate pricing quotes based on real-time traffic conditions.
Time-dependent routing:
departure_time | Example: departure_time=1563254734 | Please note that when route_type is set to shortest then the departure_time will be ineffective as the service will return the shortest path possible irrespective of the traffic conditions. |
Time-dependent routing:
Truck-specific routing: | Format: height,width,length Example: truck_size=200,210,600 | This defines the dimensions of a truck in centimetres (cm). This parameter is effective only when the mode=truck. Maximum dimensions are as follows: Height = 1000 cm Width = 5000 cm Length = 5000 cm |
truck_weight | Minimum: 1 Maximum: 100000 Example: truck_weight=11770 | This parameter defines the weight of the truck including trailers and shipped goods in kilograms (kg). This parameter is effective only when mode=truck. |
Route type:
route_type | Default: fastest Example: route_type=fastest Allowed Values: fastest shortest | Set the route type that needs to be returned. |
With flexible mode, the results are based on the selected departure time and traffic conditions at a particular time.
One use case for Flexible DM - Employee transportation where shuttles need to be planned in advance for specific time slots during the route optimization process. Another example is the advanced ride booking on services like Ola or Uber, where the time-dependent API is used to provide accurate pricing quotes based on real-time traffic conditions.
Q12. What are mandatory parameters w.r.t NextBillion.ai’s Distance Matrix API?
Ans: The standard version supports car as the default mode of transport along with following mandatory parameters:
For the flexible version, only car and truck mode is enabled. Pedestrian mode can be enabled for a region on request. Others can be discussed on a case by case basis.
Please reach out to the NextBillion.ai customer support team to check the availability of the flexible version in the desired geography or add new modes.
Origin | Format: latitude_1,longitude_1|latitude_2,longitude_2|... Example: origins:41.349302,2.136480|41.389925,2.136258|41.357961,2.097878 |
origins are the starting point of your route. Ensure that origins are routable land locations. Multiple origins should be separated by a pipe symbol (|). |
Destination | Format: latitude,longitude Example: destination=41.349302,2.136480 |
destination is the ending point of your route. Ensure that destination is a routable land location. |
For the flexible version, only car and truck mode is enabled. Pedestrian mode can be enabled for a region on request. Others can be discussed on a case by case basis.
Please reach out to the NextBillion.ai customer support team to check the availability of the flexible version in the desired geography or add new modes.
Q13. Are there any cons to using flexible NextBillion.ai Distance Matrix API instead of standard?
Ans: The latency is high compared to the standard version. The standard version returns the distance and travel time much faster than the flexible version. But the results are far more accurate for the specified departure time. You can see the latency difference in this demo.
So depending on the customer's use case, we can determine which version would suit their needs better.
So depending on the customer's use case, we can determine which version would suit their needs better.
Q14. What are the API Methods available for Distance Matrix API?
Distance Matrix Fast API supports both HTTPS GET and POST methods. The parameters, request URL and response schema are exactly the same for both methods. However, an important difference between these methods is the size of the origins and destinations sets that can be shared in the input.
For GET Request, It is recommended to use when the total number of locations including both origins and destinations is less than 100.
For POST Request, It is recommended to use when the total number of locations including both origins and destinations is more than 100.
For GET Request, It is recommended to use when the total number of locations including both origins and destinations is less than 100.
For POST Request, It is recommended to use when the total number of locations including both origins and destinations is more than 100.