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 CalculateRouteMatrix API operation.

Syntax

Get-LOCRouteMatrix
-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>
-Key <String>
-Dimensions_Length <Double>
-Weight_Total <Double>
-TravelMode <TravelMode>
-Dimensions_Unit <DimensionUnit>
-Weight_Unit <VehicleWeightUnit>
-Dimensions_Width <Double>
-Select <String>
-PassThru <SwitchParameter>
-ClientConfig <AmazonLocationServiceConfig>

Description

Calculates a route matrix given the following required parameters: DeparturePositions and DestinationPositions. CalculateRouteMatrix calculates routes and returns the travel time and travel distance from each departure position to each destination position in the request. For example, given departure positions A and B, and destination positions X and Y, CalculateRouteMatrix will return time and distance for routes from A to X, A to Y, B to X, and B to Y (in that order). The number of results returned (and routes calculated) will be the number of DeparturePositions times the number of DestinationPositions. Your account is charged for each route calculated, not the number of requests. 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 routes. Additional options include:
  • Specifying a departure time using either DepartureTime or DepartNow. This calculates routes based on predictive traffic data at the given time. You can't specify both DepartureTime and DepartNow in a single request. Specifying both parameters returns a validation error.
  • Specifying a travel mode using TravelMode sets the transportation mode used to calculate the routes. This also lets you specify additional route preferences in 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 matrix.
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
Amazon.PowerShell.Cmdlets.LOC.AmazonLocationServiceClientCmdlet.ClientConfig
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-DepartNow <Boolean>
Sets the time of departure as the current time. Uses the current time to calculate the route matrix. You can't set both DepartureTime and DepartNow. If neither is set, the best time of day to travel with the best traffic conditions is used to calculate the route matrix.Default Value: falseValid Values: false | true
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-DeparturePosition <Double[][]>
The list of departure (origin) positions for the route matrix. An array of points, each of which is itself a 2-value array defined in WGS 84 format: [longitude, latitude]. For example, [-123.115, 49.285].Depending on the data provider selected in the route calculator resource there may be additional restrictions on the inputs you can choose. See Position restrictions in the Amazon Location Service Developer Guide.For route calculators that use Esri as the data provider, if you specify a departure that's not located on a road, Amazon Location moves the position to the nearest road. The snapped value is available in the result in SnappedDeparturePositions.Valid Values: [-180 to 180,-90 to 90]
Required?True
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesDeparturePositions
-DepartureTime <DateTime>
Specifies the desired time of departure. Uses the given time to calculate the route matrix. You can't set both DepartureTime and DepartNow. If neither is set, the best time of day to travel with the best traffic conditions is used to calculate the route matrix.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 list of destination positions for the route matrix. An array of points, each of which is itself a 2-value array defined in WGS 84 format: [longitude, latitude]. For example, [-122.339, 47.615]Depending on the data provider selected in the route calculator resource there may be additional restrictions on the inputs you can choose. See Position restrictions in the Amazon Location Service Developer Guide.For route calculators that use Esri as the data provider, if you specify a destination that's not located on a road, Amazon Location moves the position to the nearest road. The snapped value is available in the result in SnappedDestinationPositions.Valid Values: [-180 to 180,-90 to 90]
Required?True
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesDestinationPositions
-Dimensions_Height <Double>
The height of the truck.
  • For example, 4.5.
For routes calculated with a HERE resource, this value must be between 0 and 50 meters.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesTruckModeOptions_Dimensions_Height
-Dimensions_Length <Double>
The length of the truck.
  • For example, 15.5.
For routes calculated with a HERE resource, this value must be between 0 and 300 meters.
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.
For routes calculated with a HERE resource, this value must be between 0 and 50 meters.
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)
-Key <String>
The optional API key to authorize the request.
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.CalculateRouteMatrixResponse). Specifying the name of a property of type Amazon.LocationService.Model.CalculateRouteMatrixResponse 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 also determines how you specify route preferences:
  • If traveling by Car use the CarModeOptions parameter.
  • If traveling by Truck use the TruckModeOptions parameter.
Bicycle or Motorcycle are only valid when using Grab as a data provider, and only within Southeast Asia.Truck is not available for Grab.For more information about using Grab as a data provider, see GrabMaps in the Amazon Location Service Developer Guide.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 tolls when calculating routes.Default Value: falseValid Values: false | true
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesTruckModeOptions_AvoidTolls
-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.CalculateRouteMatrixResponse 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