# Routing

## Car routing <a href="#car-routing" id="car-routing"></a>

Precise car routing based on high quality data delivered in ms. Distance API currently uses OSRM routing engine with OpenStreetMap data to calculate route distance and duration. Soon you will be able to choose also other providers like Google Maps and Mapbox for car routing as well as other routing profiles like Truck, Walk or Bike.

{% content-ref url="/pages/tbn8QASvAmEVnaDr1McG" %}
[routing/car](/tools/api/api-reference/routing-car.md)
{% endcontent-ref %}

### **Example result**

```json
{
  "route": {
  "car": {
    "distance": 466.1034, // car routing distance in Kilometer 
    "duration": 18095.3   // car routing duration in Seconds 
}
```

### **Under the hood**

{% embed url="<https://project-osrm.org/>" %}
[OSRM](/legal/credits.md#open-source-routing-machine-osrm) routing engine for [OSM](/legal/credits.md#openstreetmap-osm) based car routing
{% endembed %}

* Soon: More profiles like bike, walk and truck

***

## Maritime routing <a href="#maritime-routing" id="maritime-routing"></a>

Maritime Route feature employs advanced geospatial algorithms to facilitate efficient routing and distance computation between sea ports. The maritime route distance API can also snap arbitrary locations to the nearest sea route vertex.

{% content-ref url="/pages/NPQIcztl3mXnilGRpmZj" %}
[routing/maritime](/tools/api/api-reference/routing-maritime.md)
{% endcontent-ref %}

Maritime sea routing based on Eurostat data combined with modern geospatial algorithms empowering the Maritime routing API.

### **Example data**

```json
  "route": {
    "sea": {
      "distanceNM": 268.131303044648, // maritime route distance in Nautical miles
      "distance": 496.5789924839348,  // maritime route distance in Kilometer
      "duration": 13.4065651522324    // maritime travel time in Hours
     }
   }
}
```

Flatbush, the really fast **static spatial index** helps to snap any input location to the nearest sea routes vertex. This helps you to calculate maritime routes even if your input data does not reflect ports or maritime locations.

### **Under the hood**

{% embed url="<https://github.com/StephanGeorg/searoutes-api>" %}

* Eurostat maritime data
* Dijkstra's algorithm
* Flatbush spatial index


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.distance.tools/features/routing.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
