---
metadata:
  - name: generator
    content: Diplodoc Platform v5.39.1
alternate:
  - https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.driving.SegmentModel.md
  - https://yandex.com.tr/dev/jsapi-v2-1/doc/ru/v2-1/ref/reference/multiRouter.driving.SegmentModel.md
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com.tr/dev/jsapi-v2-1/doc/en/llms.txt

# multiRouter.driving.SegmentModel

{% note info %}

The constructor of the multiRouter.driving.SegmentModel class is hidden, as this class is not intended for autonomous initialization.

{% endnote %}

Extends [IEventEmitter](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IEventEmitter.md).

Data model for a segment on the path of a driving route. A segment of a driving route is a part of the path from one manoeuver to another.

[Fields](#properties-summary) | [Events](#events-summary) | [Methods](#methods-summary)

Creates the data model for a segment on the path of a driving route.

## Fields {#properties-summary}

#|
|| **Name** | **Type** | **Description** ||
|| [events](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IEventEmitter.md#events) | [IEventManager](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IEventManager.md) | Event manager.

Inherited from [IEventEmitter](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IEventEmitter.md#events). ||
|| [geometry](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.driving.SegmentModel.md#geometry) | [geometry.base.LineString](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/geometry.base.LineString.md) | Geometry of a segment. ||
|| [path](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.driving.SegmentModel.md#path) | [multiRouter.driving.PathModel](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.driving.PathModel.md) | Reference to the parent model of the path. ||
|| [properties](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.driving.SegmentModel.md#properties) | [data.Manager](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/data.Manager.md) | Segment data. The following fields are available: 
- index: Integer - The ordinal number of the segment in the array of segments 	of the corresponding route path.
- type: String - Segment type identifier, which takes the value "driving" 	for automobile segments.
- street: String - Text description of the street that the segment goes along.
- action: Object - An object with the "text" and "value" fields that describes the 	final maneuver of the segment.
- distance: Object - An object with the "text" and "value" fields that specifies the length 	of the segment in meters.
- duration: Object - An object with the "text" and "value" fields that specifies the travel time 	of the segment in seconds.
- durationInTraffic: Object - An object with the "text" and "value" fields that 	specifies the travel time of the segment (in seconds) considering traffic.
- text: String - Text description of the segment.
- viaPoints: Integer[] - Indexes of throughpoints lying on the segment.
- lodIndex: Integer - The ordinal number of the first throughpoint of the segment 	in the full set of coordinates of the corresponding route path. ||
|#

## Events {#events-summary}

#|
|| **Name** | **Description** ||
|| [update](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.driving.SegmentModel.md#event-update) | Updating the model with new data. Instance of the [Event](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class. ||
|#

## Methods {#methods-summary}

#|
|| **Name** | **Returns** | **Description** ||
|| [destroy](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.driving.SegmentModel.md#destroy)() | | Destroys a model. ||
|| [getType](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.driving.SegmentModel.md#getType)() | String | Returns ID of the segment type. For segments of automobile routes, it returns the string "driving". ||
|| [getViaPoints](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.driving.SegmentModel.md#getViaPoints)() | [multiRouter.ViaPointModel](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.ViaPointModel.md)[] | Returns an array of throughpoints on the segment. ||
|| [update](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.driving.SegmentModel.md#update)([segmentJson](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/multiRouter.driving.SegmentModel.md#update-param-segmentJson)) | | Updates the state of the model. ||
|#

## Fields details {#field_detail}

### geometry {#geometry}

```javascript
{geometry.base.LineString} geometry
```

Geometry of a segment.

### path {#path}

```javascript
{multiRouter.driving.PathModel} path
```

Reference to the parent model of the path.

### properties {#properties}

```javascript
{data.Manager} properties
```

Segment data. The following fields are available: 
- index: Integer - The ordinal number of the segment in the array of segments 	of the corresponding route path.
- type: String - Segment type identifier, which takes the value "driving" 	for automobile segments.
- street: String - Text description of the street that the segment goes along.
- action: Object - An object with the "text" and "value" fields that describes the 	final maneuver of the segment.
- distance: Object - An object with the "text" and "value" fields that specifies the length 	of the segment in meters.
- duration: Object - An object with the "text" and "value" fields that specifies the travel time 	of the segment in seconds.
- durationInTraffic: Object - An object with the "text" and "value" fields that 	specifies the travel time of the segment (in seconds) considering traffic.
- text: String - Text description of the segment.
- viaPoints: Integer[] - Indexes of throughpoints lying on the segment.
- lodIndex: Integer - The ordinal number of the first throughpoint of the segment 	in the full set of coordinates of the corresponding route path.

## Events details {#event_detail}

### update {#update}

Updating the model with new data. Instance of the [Event](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class.

## Methods details {#method_detail}

### destroy {#destroy}

```javascript
{} destroy()
```

Destroys a model.

### getType {#getType}

```javascript
{String} getType()
```

**Returns** ID of the segment type. For segments of automobile routes, it returns the string "driving".

### getViaPoints {#getViaPoints}

```javascript
{multiRouter.ViaPointModel[]} getViaPoints()
```

**Returns** an array of throughpoints on the segment.

### update {#update}

```javascript
{} update(segmentJson)
```

Updates the state of the model.

**Parameters:**

#|
|| **Parameter** | **Default value** | **Description**  ||
|| [`segmentJson`](#update-param-segmentJson)[*](*star) | — | Type: Object

JSON data. ||
|#

\* Mandatory parameter/option.

[*star]: Mandatory parameter/option.