optimize_waypoints
async
¶
optimize_waypoints(
origin: Position,
*,
config_overrides: Optional[AsyncGeoRoutesClientConfig] = None,
avoid: Optional[WaypointOptimizationAvoidanceOptions] = None,
clustering: Optional[WaypointOptimizationClusteringOptions] = None,
departure_time: Optional[TimestampWithTimezoneOffset] = None,
destination: Optional[Position] = None,
destination_options: Optional[WaypointOptimizationDestinationOptions] = None,
driver: Optional[WaypointOptimizationDriverOptions] = None,
exclude: Optional[WaypointOptimizationExclusionOptions] = None,
key: Optional[ApiKey] = None,
optimize_sequencing_for: Optional[WaypointOptimizationSequencingObjective] = None,
origin_options: Optional[WaypointOptimizationOriginOptions] = None,
traffic: Optional[WaypointOptimizationTrafficOptions] = None,
travel_mode: Optional[WaypointOptimizationTravelMode] = None,
travel_mode_options: Optional[WaypointOptimizationTravelModeOptions] = None,
waypoints: Optional[WaypointOptimizationWaypointList] = None,
) -> OptimizeWaypointsResponse
OptimizeWaypoints calculates the optimal order to travel between a set of waypoints to minimize either the travel time or the distance travelled during the journey, based on road network restrictions and the traffic pattern data.
For more information, see Optimize waypoints in the Amazon Location Service Developer Guide.
Parameters:
-
avoid(Optional[WaypointOptimizationAvoidanceOptions], default:None) –Features that are avoided. Avoidance is on a best-case basis. If an avoidance can't be satisfied for a particular case, this setting is ignored.
-
clustering(Optional[WaypointOptimizationClusteringOptions], default:None) –Clustering allows you to specify how nearby waypoints can be clustered to improve the optimized sequence.
-
departure_time(Optional[TimestampWithTimezoneOffset], default:None) –Departure time from the waypoint.
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 -
destination(Optional[Position], default:None) –The final position for the route in the World Geodetic System (WGS 84) format:
[longitude, latitude]. -
destination_options(Optional[WaypointOptimizationDestinationOptions], default:None) –Destination related options.
-
driver(Optional[WaypointOptimizationDriverOptions], default:None) –Driver related options.
-
exclude(Optional[WaypointOptimizationExclusionOptions], default:None) –Features to be strictly excluded while calculating the route.
-
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_sequencing_for(Optional[WaypointOptimizationSequencingObjective], default:None) –Specifies the optimization criteria for the calculated sequence.
Default value:
FastestRoute. -
origin(Position) –The start position for the route in World Geodetic System (WGS 84) format: [longitude, latitude].
-
origin_options(Optional[WaypointOptimizationOriginOptions], default:None) –Origin related options.
-
traffic(Optional[WaypointOptimizationTrafficOptions], default:None) –Traffic-related options.
-
travel_mode(Optional[WaypointOptimizationTravelMode], default:None) –Specifies the mode of transport when calculating a route. Used in estimating the speed of travel and road compatibility.
Default value:
Car -
travel_mode_options(Optional[WaypointOptimizationTravelModeOptions], default:None) –Travel mode related options for the provided travel mode.
-
waypoints(Optional[WaypointOptimizationWaypointList], default:None) –List of waypoints between the
OriginandDestination, in World Geodetic System (WGS 84) format: [longitude, latitude].The maximum number of waypoints allowed per request:
-
Maximum 50 waypoints per request
-
Maximum 20 waypoints when using constraints (
AccessHours,AppointmentTime,ServiceDuration,Heading,SideOfStreet,Before)
-
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/async_geo_routes.py
735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 | |