Calculate a route between two points
routing().route(RoutingRouteParamsparams, RequestOptionsrequestOptions = RequestOptions.none()) : RouteResult
POST/api/v1/route
Calculate a route between two points
package com.plazafyi.example
import com.plazafyi.client.PlazaClient
import com.plazafyi.client.okhttp.PlazaOkHttpClient
import com.plazafyi.models.routing.RouteRequest
import com.plazafyi.models.routing.RouteResult
import com.plazafyi.models.routing.RoutingRouteParams
fun main() {
val client: PlazaClient = PlazaOkHttpClient.fromEnv()
val params: RouteRequest = RouteRequest.builder()
.destination(RouteRequest.Destination.builder()
.lat(48.8584)
.lng(2.2945)
.build())
.origin(RouteRequest.Origin.builder()
.lat(48.8566)
.lng(2.3522)
.build())
.build()
val routeResult: RouteResult = client.routing().route(params)
}{
"geometry": {
"coordinates": [
2.3522,
48.8566
],
"type": "Point"
},
"properties": {
"distance_m": 4523.7,
"duration_s": 847.2,
"annotations": {
"foo": "bar"
},
"charge_profile": [
[
0
]
],
"charging_stops": [
{
"foo": "bar"
}
],
"edges": [
{
"foo": "bar"
}
],
"energy_used_wh": 0
},
"type": "Feature"
}Returns Examples
{
"geometry": {
"coordinates": [
2.3522,
48.8566
],
"type": "Point"
},
"properties": {
"distance_m": 4523.7,
"duration_s": 847.2,
"annotations": {
"foo": "bar"
},
"charge_profile": [
[
0
]
],
"charging_stops": [
{
"foo": "bar"
}
],
"edges": [
{
"foo": "bar"
}
],
"energy_used_wh": 0
},
"type": "Feature"
}