# Segmentation

Leveraging advanced geospatial algorithms and comprehensive data, the Road-Type Analysis provides granular insights into route distances based on diverse road categories, enhancing navigation precision. Simultaneously, the Country-wise Breakdown feature utilizes real-time geopolitical data to furnish a detailed spatial distribution of distances across individual countries.

## Route segmentation <a href="#route-segmentation" id="route-segmentation"></a>

### **Country-wise Distance Breakdown** <a href="#country-wise-distance-breakdown" id="country-wise-distance-breakdown"></a>

The "Country-wise Distance Breakdown" feature delivers a comprehensive breakdown of route distances based on individual **countries traversed**. Utilizing real-time geopolitical data and advanced geospatial analysis, this functionality offers developers a powerful tool for route optimization, compliance assessment, and logistical planning. It seamlessly integrates into applications, providing users with insights into the spatial distribution of **distances across different countries along a specified route**.

#### **Example response for&#x20;**<mark style="background-color:green;">**Oslo,NOR to Berlin,DEU**</mark>

```json
{
  "route": {
    "car": {
      "distance": 812.1059,      // distance in kilometers of entire route
      "duration": 39012.7,       // duration in seconds of entire travel time 
      "countries": [{
        "country": "NO",
	"distance": 169.1616589, // distance in kilometers driven through Norway
	"duration": 8126.34541   // duration in seconds driven through Norway
      }, {
	"country": "DK",         
	"distance": 379.65950825,// distance in kilometers driven through Danmark 
	"duration": 18238.43725  // duration in seconds driven through Danmark
      }, {
        "country": "DE",  
        "distance": 157.87338696, // distance in kilometers driven through Germany
        "duration": 7584.068879   // duration in seconds driven through Germany
      }]
    }
  }
}
```

### **Road-Type Segmented Distance Analysis** <a href="#road-type-segmented-distance-analysis" id="road-type-segmented-distance-analysis"></a>

offering detailed insights into route distances segmented by various road types. Leveraging advanced geospatial algorithms and comprehensive road network data, this functionality breaks down the total distance of a specified route, providing a granular analysis of residential roads, highways, and speed conditions.

* Granular breakdown of route distances by road types.
* Integration of comprehensive road network data.
* Seamless incorporation into applications for enhanced route planning.

### Midpoint calculation <a href="#midpoint-calculation" id="midpoint-calculation"></a>

Get the midpoint of a route and all midpoints of each route step. See where you are halfway through a journey or where you can meet someone in the middle.


---

# 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/segmentation.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.
