AWS Tools for Windows PowerShell
Command Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Synopsis

Calls the Amazon Location Service CalculateRoute API operation.

Syntax

Get-LOCRoute
-CalculatorName <String>
-CarModeOptions_AvoidFerry <Boolean>
-TruckModeOptions_AvoidFerry <Boolean>
-CarModeOptions_AvoidToll <Boolean>
-TruckModeOptions_AvoidToll <Boolean>
-DepartNow <Boolean>
-DeparturePosition <Double[]>
-DepartureTime <DateTime>
-DestinationPosition <Double[]>
-DistanceUnit <DistanceUnit>
-Dimensions_Height <Double>
-IncludeLegGeometry <Boolean>
-Dimensions_Length <Double>
-Weight_Total <Double>
-TravelMode <TravelMode>
-Dimensions_Unit <DimensionUnit>
-Weight_Unit <VehicleWeightUnit>
-WaypointPosition <Double[][]>
-Dimensions_Width <Double>
-Select <String>
-PassThru <SwitchParameter>

Description

Calculates a route given the following required parameters: DeparturePostiton and DestinationPosition. Requires that you first create a route calculator resource. By default, a request that doesn't specify a departure time uses the best time of day to travel with the best traffic conditions when calculating the route. Additional options include:
  • Specifying a departure time using either DepartureTime or DepartureNow. This calculates a route based on predictive traffic data at the given time. You can't specify both DepartureTime and DepartureNow in a single request. Specifying both parameters returns a validation error.
  • Specifying a travel mode using TravelMode. This lets you specify an additional route preference such as CarModeOptions if traveling by Car, or TruckModeOptions if traveling by Truck.

Parameters

-CalculatorName <String>
The name of the route calculator resource that you want to use to calculate the route.
Required?True
Position?1
Accept pipeline input?True (ByValue, ByPropertyName)
-CarModeOptions_AvoidFerry <Boolean>
Avoids ferries when calculating routes.Default Value: falseValid Values: false | true
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesCarModeOptions_AvoidFerries
-CarModeOptions_AvoidToll <Boolean>
Avoids tolls when calculating routes.Default Value: falseValid Values: false | true
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesCarModeOptions_AvoidTolls
-DepartNow <Boolean>
Sets the time of departure as the current time. Uses the current time to calculate a route. Otherwise, the best time of day to travel with the best traffic conditions is used to calculate the route.Default Value: falseValid Values: false | true
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-DeparturePosition <Double[]>
The start position for the route. Defined in WGS 84 format: [longitude, latitude].
  • For example, [-123.115, 49.285]
If you specify a departure that's not located on a road, Amazon Location moves the position to the nearest road. If Esri is the provider for your route calculator, specifying a route that is longer than 400 km returns a 400 RoutesValidationException error.Valid Values: [-180 to 180,-90 to 90]
Required?True
Position?Named
Accept pipeline input?True (ByPropertyName)
-DepartureTime <DateTime>
Specifies the desired time of departure. Uses the given time to calculate the route. Otherwise, the best time of day to travel with the best traffic conditions is used to calculate the route.Setting a departure time in the past returns a 400 ValidationException error.
  • In ISO 8601 format: YYYY-MM-DDThh:mm:ss.sssZ. For example, 2020–07-2T12:15:20.000Z+01:00
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-DestinationPosition <Double[]>
The finish position for the route. Defined in WGS 84 format: [longitude, latitude].
  • For example, [-122.339, 47.615]
If you specify a destination that's not located on a road, Amazon Location moves the position to the nearest road. Valid Values: [-180 to 180,-90 to 90]
Required?True
Position?Named
Accept pipeline input?True (ByPropertyName)
-Dimensions_Height <Double>
The height of the truck.
  • For example, 4.5.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesTruckModeOptions_Dimensions_Height
-Dimensions_Length <Double>
The length of the truck.
  • For example, 15.5.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesTruckModeOptions_Dimensions_Length
-Dimensions_Unit <DimensionUnit>
Specifies the unit of measurement for the truck dimensions.Default Value: Meters
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesTruckModeOptions_Dimensions_Unit
-Dimensions_Width <Double>
The width of the truck.
  • For example, 4.5.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesTruckModeOptions_Dimensions_Width
-DistanceUnit <DistanceUnit>
Set the unit system to specify the distance.Default Value: Kilometers
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-IncludeLegGeometry <Boolean>
Set to include the geometry details in the result for each path between a pair of positions.Default Value: falseValid Values: false | true
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-PassThru <SwitchParameter>
Changes the cmdlet behavior to return the value passed to the CalculatorName parameter. The -PassThru parameter is deprecated, use -Select '^CalculatorName' instead. This parameter will be removed in a future version.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-Select <String>
Use the -Select parameter to control the cmdlet output. The default value is '*'. Specifying -Select '*' will result in the cmdlet returning the whole service response (Amazon.LocationService.Model.CalculateRouteResponse). Specifying the name of a property of type Amazon.LocationService.Model.CalculateRouteResponse will result in that property being returned. Specifying -Select '^ParameterName' will result in the cmdlet returning the selected cmdlet parameter value.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-TravelMode <TravelMode>
Specifies the mode of transport when calculating a route. Used in estimating the speed of travel and road compatibility.The TravelMode you specify determines how you specify route preferences:
  • If traveling by Car use the CarModeOptions parameter.
  • If traveling by Truck use the TruckModeOptions parameter.
Default Value: Car
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-TruckModeOptions_AvoidFerry <Boolean>
Avoids ferries when calculating routes.Default Value: falseValid Values: false | true
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesTruckModeOptions_AvoidFerries
-TruckModeOptions_AvoidToll <Boolean>
Avoids ferries when calculating routes.Default Value: falseValid Values: false | true
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesTruckModeOptions_AvoidTolls
-WaypointPosition <Double[][]>
Specifies an ordered list of up to 23 intermediate positions to include along a route between the departure position and destination position.
  • For example, from the DeparturePosition[-123.115, 49.285], the route follows the order that the waypoint positions are given [[-122.757, 49.0021],[-122.349, 47.620]]
If you specify a waypoint position that's not located on a road, Amazon Location moves the position to the nearest road. Specifying more than 23 waypoints returns a 400 ValidationException error.If Esri is the provider for your route calculator, specifying a route that is longer than 400 km returns a 400 RoutesValidationException error.Valid Values: [-180 to 180,-90 to 90]
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesWaypointPositions
-Weight_Total <Double>
The total weight of the truck.
  • For example, 3500.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesTruckModeOptions_Weight_Total
-Weight_Unit <VehicleWeightUnit>
The unit of measurement to use for the truck weight.Default Value: Kilograms
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesTruckModeOptions_Weight_Unit

Common Credential and Region Parameters

-AccessKey <String>
The AWS access key for the user account. This can be a temporary access key if the corresponding session token is supplied to the -SessionToken parameter.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesAK
-Credential <AWSCredentials>
An AWSCredentials object instance containing access and secret key information, and optionally a token for session-based credentials.
Required?False
Position?Named
Accept pipeline input?True (ByValue, ByPropertyName)
-EndpointUrl <String>
The endpoint to make the call against.Note: This parameter is primarily for internal AWS use and is not required/should not be specified for normal usage. The cmdlets normally determine which endpoint to call based on the region specified to the -Region parameter or set as default in the shell (via Set-DefaultAWSRegion). Only specify this parameter if you must direct the call to a specific custom endpoint.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-NetworkCredential <PSCredential>
Used with SAML-based authentication when ProfileName references a SAML role profile. Contains the network credentials to be supplied during authentication with the configured identity provider's endpoint. This parameter is not required if the user's default network identity can or should be used during authentication.
Required?False
Position?Named
Accept pipeline input?True (ByValue, ByPropertyName)
-ProfileLocation <String>
Used to specify the name and location of the ini-format credential file (shared with the AWS CLI and other AWS SDKs)If this optional parameter is omitted this cmdlet will search the encrypted credential file used by the AWS SDK for .NET and AWS Toolkit for Visual Studio first. If the profile is not found then the cmdlet will search in the ini-format credential file at the default location: (user's home directory)\.aws\credentials.If this parameter is specified then this cmdlet will only search the ini-format credential file at the location given.As the current folder can vary in a shell or during script execution it is advised that you use specify a fully qualified path instead of a relative path.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesAWSProfilesLocation, ProfilesLocation
-ProfileName <String>
The user-defined name of an AWS credentials or SAML-based role profile containing credential information. The profile is expected to be found in the secure credential file shared with the AWS SDK for .NET and AWS Toolkit for Visual Studio. You can also specify the name of a profile stored in the .ini-format credential file used with the AWS CLI and other AWS SDKs.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesStoredCredentials, AWSProfileName
-Region <Object>
The system name of an AWS region or an AWSRegion instance. This governs the endpoint that will be used when calling service operations. Note that the AWS resources referenced in a call are usually region-specific.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesRegionToCall
-SecretKey <String>
The AWS secret key for the user account. This can be a temporary secret key if the corresponding session token is supplied to the -SessionToken parameter.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesSK, SecretAccessKey
-SessionToken <String>
The session token if the access and secret keys are temporary session-based credentials.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesST

Outputs

This cmdlet returns an Amazon.LocationService.Model.CalculateRouteResponse object containing multiple properties. The object can also be referenced from properties attached to the cmdlet entry in the $AWSHistory stack.

Supported Version

AWS Tools for PowerShell: 2.x.y.z