Route sections

VERSION 0.2.1455
PUBLIC PREVIEW

Route sections are parts of the planned route that have specific characteristics, such as ones on a ferry or motorway, or sections with traffic incidents in them. Using sections, you can show users where these things lie on a planned route.

Route sections can be requested using RoutingOptions. Read more about route planning in the Planning a route guide.

The RoutingOptions.sectionTypes parameter specifies which section types should be included in the result. The SectionTypes are provided to RoutingOptionsBuilder as an array, so you can provide more than one. The array of supported section types can be found further in this guide.

1let amsterdamCoordinate = CLLocationCoordinate2DMake(52.3764527, 4.9062047)
2let berlinCoordinate = CLLocationCoordinate2DMake(52.5069751, 13.3631919)
3
4let options = RoutingOptionsBuilder(origin: amsterdamCoordinate, destination: berlinCoordinate)
5 .with(sectionTypes: [.lanes, .motorway, .tunnel])
6 .build()

If a specific SectionType was included in the request, the appropriate value is returned in the response. Specific sections can be found within the Route object by the corresponding properties like motorwaySections, laneSections etc.

If no section types were set in the request, an empty list will be returned.

1guard let route = response.routes?.first else { return }
2let laneSections = route.laneSections
3let motorwaySections = route.motorwaySections
4let trafficSections = route.trafficSections

Each section in the response has three basic properties:

However, some of the specific section types return additional information about the section.

The possible section types are:

  • LaneSection - Represents a route section with a lane section available. It additionally provides:
    • Information about the Lane and Direction the driver should follow.
    • Information about the lane separators.
  • TrafficSection - Represents a route section with traffic information. It also provides:
    • The category of the incident. There will never be more than one incident in any section.
    • The delay caused by the incident (in seconds).
    • The magnitude of the delay caused by the incident.
    • Detailed information about the incident (TPEG2-TEC standard).
    • The average effective speed in that section (in km/h).
  • TravelModeSection - Represents a route section with travel mode.
  • SpeedLimitSection - Represents a route section with a speed limit.
    • Provides the speed limit in the section in kilometers per hour.
  • TollRoadSection - Represents a route section that requires a toll payment.
  • FerrySection - Represents a route section that is a ferry.
  • MotorwaySection - Represents a route section that is a motorway.
  • CarTrainSection - Represents a route section that has a car train.
  • TunnelSection - Represents a route section with a tunnel.
  • PedestrianSection - Represents a route section with pedestrian area.
  • TollVignetteSection - Represents a route section that requires a toll vignette.
  • CountrySection - Represents a route section that is considered as a country road.
  • RoadShieldSection - Represents a route section with shield marked part of the road.
  • UrbanSection = Represents a route section that is location within urban areas.
  • CarpoolSection = Represents a route section that requires use of carpool (HOV/High Occupancy Vehicle) lanes.