calculate_route_matrix
¶
calculate_route_matrix(
destinations: RouteMatrixDestinationList,
origins: RouteMatrixOriginList,
*,
config_overrides: Optional[GeoRoutesClientConfig] = None,
allow: Optional[RouteMatrixAllowOptions] = None,
avoid: Optional[RouteMatrixAvoidanceOptions] = None,
depart_now: Optional[SensitiveBoolean] = None,
departure_time: Optional[TimestampWithTimezoneOffset] = None,
exclude: Optional[RouteMatrixExclusionOptions] = None,
key: Optional[ApiKey] = None,
optimize_routing_for: Optional[RoutingObjective] = None,
routing_boundary: Optional[RouteMatrixBoundary] = None,
traffic: Optional[RouteMatrixTrafficOptions] = None,
travel_mode: Optional[RouteMatrixTravelMode] = None,
travel_mode_options: Optional[RouteMatrixTravelModeOptions] = None,
) -> CalculateRouteMatrixResponse
Use CalculateRouteMatrix to compute results for all pairs of Origins to Destinations. Each row corresponds to one entry in Origins. Each entry in the row corresponds to the route from that entry in Origins to an entry in Destinations positions.
For more information, see Calculate route matrix in the Amazon Location Service Developer Guide.
Parameters:
-
allow(Optional[RouteMatrixAllowOptions], default:None) –Features that are allowed while calculating a route.
-
avoid(Optional[RouteMatrixAvoidanceOptions], default:None) –Features that are avoided while calculating a route. Avoidance is on a best-case basis. If an avoidance can't be satisfied for a particular case, it violates the avoidance and the returned response produces a notice for the violation. For GrabMaps customers,
ap-southeast-1andap-southeast-5regions support onlyTollRoads,Ferries, andControlledAccessHighways. -
depart_now(Optional[SensitiveBoolean], default:None) –Uses the current time as the time of departure.
-
departure_time(Optional[TimestampWithTimezoneOffset], default:None) –Time of departure from the origin.
Time format:
YYYY-MM-DDThh:mm:ss.sssZ | YYYY-MM-DDThh:mm:ss.sss+hh:mmExamples:
2020-04-22T17:57:24Z2020-04-22T17:57:24+02:00 -
destinations(RouteMatrixDestinationList) –List of destinations for the route in World Geodetic System (WGS 84) format: [longitude, latitude].
Route calculations are billed for each origin and destination pair. If you use a large matrix of origins and destinations, your costs will increase accordingly. For more information, see Routes pricing in the Amazon Location Service Developer Guide.
The maximum number of destinations depends on the routing boundary configuration:
-
With
RoutingBoundary.Geometryset: maximum 500 destinations -
With
RoutingBoundary.Unboundedset totrue: maximum 100 destinations -
For GrabMaps customers in
ap-southeast-1andap-southeast-5: maximum 350 destinations
The total matrix size (origins × destinations) must not exceed:
-
With
RoutingBoundary.Geometry: 160,000 -
With
RoutingBoundary.Unbounded: 100 -
For GrabMaps customers in
ap-southeast-1andap-southeast-5: 122,500
-
-
exclude(Optional[RouteMatrixExclusionOptions], default:None) –Features to be strictly excluded while calculating the route. Not supported in
ap-southeast-1andap-southeast-5regions for GrabMaps customers. -
key(Optional[ApiKey], default:None) –Optional: The API key to be used for authorization. Either an API key or valid SigV4 signature must be provided when making a request.
-
optimize_routing_for(Optional[RoutingObjective], default:None) –Controls the trade-off between finding the shortest travel time (
FastestRoute) and the shortest distance (ShortestRoute) when calculating reachable areas.Default value:
FastestRoute -
origins(RouteMatrixOriginList) –List of origins for the route in World Geodetic System (WGS 84) format: [longitude, latitude].
Route calculations are billed for each origin and destination pair. Using a large amount of Origins in a request can lead you to incur unexpected charges. For more information, see Routes pricing in the Amazon Location Service Developer Guide.
The maximum number of origins depends on the routing boundary configuration:
-
With
RoutingBoundary.Geometryset: maximum 500 origins -
With
RoutingBoundary.Unboundedset totrue: maximum 15 origins -
For GrabMaps customers in
ap-southeast-1andap-southeast-5: maximum 350 origins
The total matrix size (origins × destinations) must not exceed:
-
With
RoutingBoundary.Geometry: 160,000 -
With
RoutingBoundary.Unbounded: 100 -
For GrabMaps customers in
ap-southeast-1andap-southeast-5: 122,500
-
-
routing_boundary(Optional[RouteMatrixBoundary], default:None) –Boundary within which the matrix is to be calculated. All data, origins and destinations outside the boundary are considered invalid. For GrabMaps customers,
ap-southeast-1andap-southeast-5regions support onlyUnboundedset totrue.Default value:
Unbounded set to trueWhen
AutoCircleis set in the request, the response routing boundary will returnCirclederived from theAutoCirclesettings. -
traffic(Optional[RouteMatrixTrafficOptions], default:None) –Traffic related options. Not supported in
ap-southeast-1andap-southeast-5regions for GrabMaps customers. -
travel_mode(Optional[RouteMatrixTravelMode], default:None) –Specifies the mode of transport when calculating a route. Used in estimating the speed of travel and road compatibility. For GrabMaps customers,
ap-southeast-1andap-southeast-5regions support onlyCar,Pedestrian, andScooter.Default value:
Car -
travel_mode_options(Optional[RouteMatrixTravelModeOptions], default:None) –Travel mode related options for the provided travel mode. Not supported in
ap-southeast-1andap-southeast-5regions for GrabMaps customers.
Raises:
-
AccessDeniedException–You don't have sufficient access to perform this action.
-
InternalServerException–The request processing has failed because of an unknown error, exception or failure.
-
ThrottlingException–The request was denied due to request throttling.
-
ValidationException–The input fails to satisfy the constraints specified by an AWS service.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_geo_routes/_services/geo_routes.py
380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 | |