Get started

This section outlines how to quickly get started using the HERE Traffic Vector Tile API on the HERE platform

  1. Get a HERE account
  2. Create a project
  3. Get an API key
  4. Send a request
  5. Next steps

Note

This section provides information on the minimum setup required to quickly begin using the HERE Traffic Vector Tile API. For more detailed information on HERE account setup, project creation, app registration, and authentication, see the Identity & Access Management Guide.

Get a HERE account

You can get started with a free HERE platform account from the flexible HERE Base Plan. For more information, see the HERE Base Plan Pricing. Alternatively, if your company has already established a HERE platform organization, contact your organization admin who can invite you to join your company's organization.

Create a project

To create a project, follow these steps:

  1. Sign in to the HERE platform using your HERE account.
  2. Open the Projects Manager from the launcher.
  3. Click Create new project.
  4. Enter a name for the project. Project names don't have to be unique.
  5. Enter a project ID. Project IDs must be unique within an organization and cannot be changed for the lifetime of the organization. Project IDs must be between 4 and 16 characters in length.
  6. Optional: Enter a description.
  7. Click Save.
  8. On the Resources tab, select Services and then click Link a Service.
  9. Search for the HERE Vector Tile - Traffic service and click Link.
  10. Click Done.

Get an API key

To get an API key, follow these steps:

  1. Sign in to the HERE platform using your HERE account.
  2. Select the Access Manager from the launcher.
  3. Select the Apps tab and click Register new app.
  4. Enter a name for the app.
  5. Optional: Enter a description for the app.
  6. Under New app, select Create.
  7. Optional: Select the project you created in the previous procedure from the Default access to a project field.
  8. Click Register. The HERE platform creates a new app with a unique app ID.
  9. On the Credentials tab, select API Keys and then click Create API key to generate a maximum of two API Keys for your application authentication credentials. The API key is created and displayed.

Send a request

To send a request, follow these steps:

  1. Select a zoom level value between 0 and 17.
  2. Convert your latitude and longitude into col and row values. For more information, see Mercator Projection.
  3. Request the traffic tile.

    For example, the following command requests a tile with a flow layer using Mercator projection at zoom layer 11, with x and y coordinates at 1100 and 673 respectively in Map Vector Tile open specification format:

    Bearer token
    | Apikey
    curl -H "Authorization: Bearer TOKEN_HERE" ""
    curl "https://traffic.vector.hereapi.com/v2/traffictiles/flow/mc/11/1100/673/omv?apikey=APIKEY_HERE"
  4. Decode the tile using the related Protobuf schema.

Obtain a traffic vector tile with incidents events

To get a traffic vector tile with incidents events, use the incident layer parameter.

The following example demonstrates how to get only incident events.

{% codetabs name="Bearer token", type="bash" -%}
curl -H "Authorization: Bearer TOKEN_HERE" "{{book.traffic.baseUrl}}{{book.traffic.examplePathIncident}}"
{%- language name="| Apikey", type="bash" -%}
curl "{{book.standard.baseUrl}}{{book.standard.examplePathIncident}}?apikey=APIKEY_HERE"
{%- endcodetabs %}

The response will contain traffic_incident and incident_icons layers with information about incident events for the particular tile.

The following figure illustrates an example of a rendered vector tile response with traffic_incident and incident_icons layers.

Vector tile with incidents layers
Figure 1. Vector tile with incidents layers

Obtain a traffic vector tile with flow events

To get a traffic vector tile with flow events, use the flow layer parameter.

The following example demonstrates a traffic tile request for getting only traffic vector tiles with flow events.

{% codetabs name="Bearer token", type="bash" -%}
curl -H "Authorization: Bearer TOKEN_HERE" "{{book.traffic.baseUrl}}{{book.traffic.examplePath}}"
{%- language name="| Apikey", type="bash" -%}
curl "{{book.standard.baseUrl}}{{book.standard.examplePath}}?apikey=APIKEY_HERE"
{%- endcodetabs %}

The response will contain only a traffic_flow layer with information about traffic flows for the particular tile.

The following figure illustrates an example of a rendered vector tile response with a traffic_flow layer.

Vector tile with flow layer
Figure 2. Vector tile with flow layer

Obtain a traffic vector tile with both flow and incident events

To get a traffic vector tile with all events, use the traffic layer parameter.

The following example demonstrates such traffic tile request for a traffic layer parameter.

 {% codetabs name="Bearer token", type="bash" -%}
 curl -H "Authorization: Bearer TOKEN_HERE" "{{book.traffic.baseUrl}}{{book.traffic.examplePathTraffic}}"
 {%- language name="| Apikey", type="bash" -%}
 curl "{{book.standard.baseUrl}}{{book.standard.examplePathTraffic}}?apikey=APIKEY_HERE"
 {%- endcodetabs %}

The response will contain all traffic layers traffic_flow, traffic_incident and incident_icons with information about traffic for the particular tile.

The following figure illustrates an example of a rendered vector tile response with all layers.

Vector tile with all layers
Figure 3. Vector tile with all layers

Next steps

The following sections provide additional information on using the HERE Traffic Vector Tile API:

  • For an overview of traffic layers, see Layers overview.
  • For in-depth tutorials on obtaining vector tiles with events, see Tutorials.
  • For information on what regions are covered, see Traffic coverage.

results matching ""

    No results matching ""