Span

When more detailed attributes about a section are required, then you can request spans. The travel portion of a section is split into spans. The splits occur where any value of the requested attributes change.

More formally, a span is the portion of a section for which a set of attributes is the same. The set of attributes is specified in the request. Each span has an offset that indicates the index in the polyline where the span begins. The end of the span is either the offset of the next span, or to the end of the polyline if there are no other spans.

Span data can be very compact, for example only requesting speed limits on a long highway route can result in a single span for the section. Spans can also be more verbose, for example requesting many attributes within an urban area.

Requesting more span attributes generally results in more spans as this introduces more attributes that can change, and thus requires a new span. Span attributes such as length do not introduce new spans, but indicate cumulative properties. In this case, the length of the span is in meters.

Example

Example Route
Figure 1. Example Route
curl -X GET \
   'https://router.hereapi.com/v8/routes?destination=52.530394,13.400683&origin=52.530728,13.383833&return=polyline&transportMode=car'

This example demonstrates how to obtain the result of requesting spans for the following attributes:

Offset Names Speed (km/h)
0 Invalidenstraße 50
11 Invalidenstraße 30
43 Brunnenstraße 30

Street Name Spans

If you request only street names (spans=names), then are two spans for two unique street names.

...
"spans": [
  {
    "offset": 0,
    "names": [
      {
        "language": "de",
        "value": "Invalidenstraße"
      }
    ]
  },
  {
    "offset": 43,
    "names": [
      {
        "language": "de",
        "value": "Brunnenstraße"
      }
    ]
  }
],
...

Street Name and Speed Limit Spans

If you request names and speed limit, there are three spans; an additional "Invalidenstraße" span is required for the change in speed limit on that street.

...
"spans": [
  {
    "offset": 0,
    "names": [
      {
        "language": "de",
        "value": "Invalidenstraße"
      }
    ],
    "speedLimit": 50.0
  },
  {
    "offset": 11,
    "names": [
      {
        "language": "de",
        "value": "Invalidenstraße"
      }
    ],
    "speedLimit": 30.0
  },
  {
    "offset": 43,
    "names": [
      {
        "language": "de",
        "value": "Brunnenstraße"
      }
    ],
    "speedLimit": 30.0
  }
],
...

Relation to HERE Map Content

If more detailed underlying data is required, you can request the HERE Map Content topology segment ID with spans=segmentId. Spans can be more detailed than a topology segment since they are a request-specific summary of segment anchors. For more details on topology segments and segment anchors, see the HERE Map Content Data Specification under Topology Model and Topology Attribution Referencing Model.

results matching ""

    No results matching ""