Package-level declarations

Types

Link copied to clipboard
@Serializable
data class AvoidPolygons(val type: String, val coordinates: List<List<List<Double>>>)
Link copied to clipboard
@Serializable
data class Feature(val type: String, val geometry: Geometry, val properties: Map<String, JsonElement> = emptyMap())

A single GeoJSON feature within the route response.

Link copied to clipboard
@Serializable
data class GeoJsonRouteResponse(val type: String, val bbox: List<Double>, val features: List<Feature>, val metadata: Metadata)

GeoJSON response for the directions endpoint.

Link copied to clipboard
@Serializable
data class Geometry(val type: String, val coordinates: List<List<Double>>)

Geometry of a route feature.

Link copied to clipboard
@Serializable
data class GpxBounds(val asArray: List<Double>? = null, val minLon: Double, val maxLon: Double, val minLat: Double, val maxLat: Double)
Link copied to clipboard
@Serializable
data class GpxMetadata(val name: String? = null, val description: String? = null, val author: JsonElement? = null, val copyright: JsonElement? = null, val timeGenerated: String? = null, val bounds: GpxBounds? = null, val extensions: JsonElement? = null)
Link copied to clipboard
@Serializable
data class GpxResponse(val metadata: GpxMetadata, val routes: List<JsonElement> = emptyList(), val extensions: JsonElement? = null, val gpxRouteElements: List<JsonElement> = emptyList())

GPX response returned by the directions endpoint when requesting GPX.

Link copied to clipboard
@Serializable
data class ProfileParams(val weightings: Weightings? = null, val restrictions: Restrictions? = null)
Link copied to clipboard
@Serializable
data class Restrictions(val maxHeight: Double? = null, val maxWidth: Double? = null, val maxWeight: Double? = null, val maxLength: Double? = null)
Link copied to clipboard
@Serializable
data class Route(val summary: RouteSummary, val segments: List<Segment>, val geometry: String? = null, val wayPoints: List<Int>? = null)

Single route variant returned by the API.

Link copied to clipboard
@Serializable
data class RouteOptions(val avoidFeatures: List<String>? = null, val avoidPolygons: AvoidPolygons? = null, val profileParams: ProfileParams? = null)
Link copied to clipboard
@Serializable
data class RouteRequest(val coordinates: List<List<Double>>, val radiuses: List<Double>? = null, val bearings: List<List<Double>>? = null, val elevation: Boolean? = null, val extraInfo: List<String>? = null, val instructions: Boolean? = null, val instructionsFormat: String? = null, val language: String? = null, val preference: String? = null, val units: String? = null, val geometry: Boolean? = null, val geometrySimplify: Boolean? = null, val roundaboutExits: Boolean? = null, val attributes: List<String>? = null, val maneuvers: Boolean? = null, val continueStraight: Boolean? = null, val options: RouteOptions? = null)

Payload for the directions v2/directions/{profile} endpoint.

Link copied to clipboard

Builder used by routeRequest.

Link copied to clipboard

Java-friendly builder

Link copied to clipboard
@Serializable
data class RouteResponse(val routes: List<Route>, val bbox: List<Double>, val metadata: Metadata? = null)

Response from the directions endpoint.

Link copied to clipboard
@Serializable
data class RouteSummary(val distance: Double, val duration: Double, val ascent: Double? = null, val descent: Double? = null)

Aggregated summary of a route.

Link copied to clipboard
@Serializable
data class Segment(val distance: Double, val duration: Double, val steps: List<Step>? = null, val ascent: Double? = null, val descent: Double? = null, val detourFactor: Double? = null, val percentage: Double? = null)

One segment between intermediate waypoints.

Link copied to clipboard
@Serializable
data class Step(val distance: Double, val duration: Double, val instruction: String, val name: String, val type: Int, val wayPoints: List<Int>, val exitNumber: Int? = null)

Turn instruction within a segment.

Link copied to clipboard
@Serializable
data class WeightingFactor(val factor: Double)
Link copied to clipboard
@Serializable
data class Weightings(val green: WeightingFactor? = null, val quiet: WeightingFactor? = null, val shortest: WeightingFactor? = null)

Functions

Link copied to clipboard

DSL for constructing RouteRequest instances.