## Calculate a route between two points `routing.route(**kwargs) -> RouteResult` **post** `/api/v1/route` Calculate a route between two points ### Parameters - `destination: GeoJsonGeometry` Destination point (GeoJSON Point geometry) - `coordinates: Array[Float] | Array[Array[Float]] | Array[Array[Array[Float]]] | Array[Array[Array[Array[Float]]]]` GeoJSON coordinates array (nesting depth varies by geometry type) - `Array[Float]` - `Array[Array[Float]]` - `Array[Array[Array[Float]]]` - `Array[Array[Array[Array[Float]]]]` - `type: :Point | :LineString | :Polygon | 3 more` - `:Point` - `:LineString` - `:Polygon` - `:MultiPoint` - `:MultiLineString` - `:MultiPolygon` - `origin: GeoJsonGeometry` Origin point (GeoJSON Point geometry) - `mode: :auto | :foot | :bicycle` - `:auto` - `:foot` - `:bicycle` ### Returns - `class RouteResult` - `geometry: GeoJsonGeometry` - `coordinates: Array[Float] | Array[Array[Float]] | Array[Array[Array[Float]]] | Array[Array[Array[Array[Float]]]]` GeoJSON coordinates array (nesting depth varies by geometry type) - `Array[Float]` - `Array[Array[Float]]` - `Array[Array[Array[Float]]]` - `Array[Array[Array[Array[Float]]]]` - `type: :Point | :LineString | :Polygon | 3 more` - `:Point` - `:LineString` - `:Polygon` - `:MultiPoint` - `:MultiLineString` - `:MultiPolygon` - `properties: { distance, duration, mode}` - `distance: Float` Total distance in meters - `duration: Float` Estimated duration in seconds - `mode: String` Travel mode used - `type: :Feature` - `:Feature` ### Example ```ruby require "plaza" plaza = Plaza::Client.new( api_key: "My API Key", environment: "local" # defaults to "production" ) route_result = plaza.routing.route( destination: {coordinates: [0], type: :Point}, origin: {coordinates: [0], type: :Point} ) puts(route_result) ```