Prerequisites - Amazon Location Service


Before you begin calculating routes, follow the prerequisite steps:

Create a route calculator resource

Before you can calculate a route, create a route calculator resource in your AWS account.

When you create a route calculator resource, you can choose from the data providers available:

  1. Esri – For more information about Esri's coverage in your region of interest, see Esri details on street networks and traffic coverage.

  2. HERE Technologies – For more information about HERE's coverage in your region of interest, see HERE car routing coverage and HERE truck routing coverage.


If your application is tracking or routing assets that you use in your business, such as delivery vehicles or employees, you may only use HERE as your geolocation provider. For more information, see section 82 of the AWS service terms.

You can do this using the Amazon Location Service console, the AWS CLI, or the Amazon Location APIs.


To create a route calculator resource using the Amazon Location console

  1. Open the Amazon Location console at

  2. In the left navigation pane, choose Route calculators.

  3. Choose Create route calculator.

  4. Fill out the following boxes:

    • Name – Enter a name for the route calculator resource. For example, ExampleCalculator. Maximum 100 characters. Valid entries include alphanumeric characters, hyphens, periods, and underscores.

    • Description – Enter an optional description.

  5. For Data providers, choose a data provider to use as a route calculator.

  6. (Optional) Under Tags, enter a tag Key and Value. This adds a tag your new route calculator resource. For more information, see Tagging your resources.

  7. Choose Create route calculator.


To create a route calculator resource using the Amazon Location APIs

Use the CreateRouteCalculator operation from the Amazon Location Places APIs.

The following example is an API request to create a route calculator resource called ExampleCalculator using the data provider Esri.

POST /routes/v0/calculators Content-type: application/json { "CalculatorName": "ExampleCalculator", "DataSource": "Esri", "Description": "string", "Tags": { "Tag1" : "Value1" } }

To create a place index resource using AWS CLI commands

Use the create-route-calculator command.

The following example creates a route calculator resource called ExampleCalculator using Esri as the data provider.

aws location \ create-route-calculator \ --calculator-name "ExampleCalculator" \ --data-source "Esri" \ --tags Tag1=Value1

Billing depends on your usage. You may incur fees for the use of other AWS services. For more information, see Amazon Location Service pricing.

Authenticating your requests

Once you create a route calculator resource and you're ready to begin building location features into your application, choose how you would authenticate your requests:

  • To explore ways you can access the services, see Accessing Amazon Location Service.

  • If you have a website with anonymous users, or you want to use your own authentication process, or combine multiple authentication methods, see Allowing unauthenticated guest access to your application using Amazon Cognito.


    The following example shows the passing of the unauthenticated identity pool as credentials when using the AWS JavaScript SDK.

    const AWS = require("aws-sdk"); const credentials = new AWS.CognitoIdentityCredentials({ IdentityPoolId: "us-east-1:54f2ba88-9390-498d-aaa5-0d97fb7ca3bd" }); const location = new AWS.Location({ credentials, region: AWS.config.region // region containing Cognito pool }); // rsp.Results contains calculated route const rsp = await location.calculateRoute({ CalculatorName: "ExampleCalculator", DeparturePosition: [-123.4567, 45.6789], DestinationPosition: [-123.123, 45.234] }).promise();