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

# ILinearRingGeometryAccess

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

Interface for access to the "Closed contour" geometry.

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

## Constructor {#constructor-summary}

```javascript
ILinearRingGeometryAccess()
```

## Fields {#properties-summary}

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

Inherited from [IFreezable](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IFreezable.md#events). ||
|#

## Events {#events-summary}

#|
|| **Name** | **Description** ||
|| [change](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ILinearRingGeometryAccess.md#event-change) | Changed coordinates. Instance of the [Event](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class. Names of fields that are available via the [Event.get](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get) method: 
- oldCoordinates - Old coordinates
- newCoordinates - New coordinates.
- oldFillRule - Old fill rule.
- newFillRule - New fill rule. ||
|#

## Methods {#methods-summary}

#|
|| **Name** | **Returns** | **Description** ||
|| [contains](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ILinearRingGeometryAccess.md#contains)([position](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ILinearRingGeometryAccess.md#contains-param-position)) | Boolean | Checks whether the passed point is located inside the contour. ||
|| [freeze](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IFreezable.md#freeze)() | [IFreezable](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IFreezable.md) | Switches the object to "frozen" mode.

Inherited from [IFreezable](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IFreezable.md#freeze). ||
|| [get](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ILinearRingGeometryAccess.md#get)([index](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ILinearRingGeometryAccess.md#get-param-index)) | Number[] | Returns coordinates of the point with the specified index. ||
|| [getChildGeometry](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ILinearRingGeometryAccess.md#getChildGeometry)([index](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ILinearRingGeometryAccess.md#getChildGeometry-param-index)) | [IPointGeometryAccess](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPointGeometryAccess.md) | Creates and returns an [IPointGeometryAccess](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPointGeometryAccess.md) object for the specified contour on the polyline. ||
|| [getClosest](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ILinearRingGeometryAccess.md#getClosest)([anchorPosition](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ILinearRingGeometryAccess.md#getClosest-param-anchorPosition)) | Object | Searches for a point on the contour closest to the anchorPosition. ||
|| [getCoordinates](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ILinearRingGeometryAccess.md#getCoordinates)() | Number[][] | Returns an array of geometry coordinates. ||
|| [getFillRule](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ILinearRingGeometryAccess.md#getFillRule)() | String | Returns ID of the fill rule. ||
|| [getLength](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ILinearRingGeometryAccess.md#getLength)() | Integer | Returns the number of points in the geometry. ||
|| [insert](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ILinearRingGeometryAccess.md#insert)([index](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ILinearRingGeometryAccess.md#insert-param-index), [coordinates](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ILinearRingGeometryAccess.md#insert-param-coordinates)) | [ILinearRingGeometryAccess](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ILinearRingGeometryAccess.md) | Adds a new point with the specified index. ||
|| [isFrozen](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IFreezable.md#isFrozen)() | Boolean | Returns true if the object is in "frozen" mode, otherwise false.

Inherited from [IFreezable](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IFreezable.md#isFrozen). ||
|| [remove](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ILinearRingGeometryAccess.md#remove)([index](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ILinearRingGeometryAccess.md#remove-param-index)) | Number[] | Removes the point with the specified index. ||
|| [set](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ILinearRingGeometryAccess.md#set)([index](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ILinearRingGeometryAccess.md#set-param-index), [coordinates](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ILinearRingGeometryAccess.md#set-param-coordinates)) | [ILinearRingGeometryAccess](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ILinearRingGeometryAccess.md) | Sets coordinates of the point with the specified index. ||
|| [setCoordinates](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ILinearRingGeometryAccess.md#setCoordinates)([coordinates](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ILinearRingGeometryAccess.md#setCoordinates-param-coordinates)) | [ILinearRingGeometryAccess](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ILinearRingGeometryAccess.md) | Sets an array of geometry coordinates. ||
|| [setFillRule](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ILinearRingGeometryAccess.md#setFillRule)([fillRule](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ILinearRingGeometryAccess.md#setFillRule-param-fillRule)) | [ILinearRingGeometryAccess](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ILinearRingGeometryAccess.md) | Sets the contour fill rule. ||
|| [splice](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ILinearRingGeometryAccess.md#splice)([index](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ILinearRingGeometryAccess.md#splice-param-index), [number](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ILinearRingGeometryAccess.md#splice-param-number)) | Number[][] | Deletes a defined number of points, starting from the specified index. New points can be added in place of the deleted ones. Coordinates of the new points can be passed as additional arguments after the "number" parameter. ||
|| [unfreeze](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IFreezable.md#unfreeze)() | [IFreezable](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IFreezable.md) | Switches the object to active mode.

Inherited from [IFreezable](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IFreezable.md#unfreeze). ||
|#

## Events details {#event_detail}

### change {#change}

Changed coordinates. Instance of the [Event](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md) class. Names of fields that are available via the [Event.get](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Event.md#get) method: 
- oldCoordinates - Old coordinates
- newCoordinates - New coordinates.
- oldFillRule - Old fill rule.
- newFillRule - New fill rule.

## Methods details {#method_detail}

### contains {#contains}

```javascript
{Boolean} contains(position)
```

Checks whether the passed point is located inside the contour.

**Returns** an indicator for whether the point belongs to the contour.

**Parameters:**

#|
|| **Parameter** | **Default value** | **Description**  ||
|| [`position`](#contains-param-position)[*](*star) | — | Type: Number[]

Coordinates of a point. ||
|#

\* Mandatory parameter/option.

### get {#get}

```javascript
{Number[]} get(index)
```

**Returns** coordinates of the point with the specified index.

**Parameters:**

#|
|| **Parameter** | **Default value** | **Description**  ||
|| [`index`](#get-param-index)[*](*star) | — | Type: Integer

Index of a point. ||
|#

\* Mandatory parameter/option.

### getChildGeometry {#getChildGeometry}

```javascript
{IPointGeometryAccess} getChildGeometry(index)
```

Creates and returns an [IPointGeometryAccess](https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IPointGeometryAccess.md) object for the specified contour on the polyline.

**Returns** the "Point" geometry object that corresponds to the specified endpoint.

**Parameters:**

#|
|| **Parameter** | **Default value** | **Description**  ||
|| [`index`](#getChildGeometry-param-index)[*](*star) | — | Type: Integer

Index of a contour vertex. ||
|#

\* Mandatory parameter/option.

### getClosest {#getClosest}

```javascript
{Object} getClosest(anchorPosition)
```

Searches for a point on the contour closest to the anchorPosition.

**Returns** an object with the following fields: 
- position - Point on the contour closest to "anchorPosition".
- distance - Distance from "anchorPosition" to "position".
- closestPointIndex - Index of the vertex closest to "position".
- nextPointIndex - Index of the vertex that follows "position".
- prevPointIndex - Index of the vertex that precedes "position".
The "nextPointIndex" and "prevPointIndex" fields may be omitted if "position" coincides with one of the contour vertexes.

**Parameters:**

#|
|| **Parameter** | **Default value** | **Description**  ||
|| [`anchorPosition`](#getClosest-param-anchorPosition)[*](*star) | — | Type: Number[]

Coordinates of a point for which the nearest contour vertex is calculated. ||
|#

\* Mandatory parameter/option.

### getCoordinates {#getCoordinates}

```javascript
{Number[][]} getCoordinates()
```

**Returns** an array of geometry coordinates.

### getFillRule {#getFillRule}

```javascript
{String} getFillRule()
```

**Returns** ID of the fill rule.

### getLength {#getLength}

```javascript
{Integer} getLength()
```

**Returns** the number of points in the geometry.

### insert {#insert}

```javascript
{ILinearRingGeometryAccess} insert(index, coordinates)
```

Adds a new point with the specified index.

**Returns** self-reference.

**Parameters:**

#|
|| **Parameter** | **Default value** | **Description**  ||
|| [`index`](#insert-param-index)[*](*star) | — | Type: Integer

Index of a point. ||
|| [`coordinates`](#insert-param-coordinates)[*](*star) | — | Type: Number[]

Coordinates of a point. ||
|#

\* Mandatory parameter/option.

### remove {#remove}

```javascript
{Number[]} remove(index)
```

Removes the point with the specified index.

**Returns** the coordinates of a deleted point.

**Parameters:**

#|
|| **Parameter** | **Default value** | **Description**  ||
|| [`index`](#remove-param-index)[*](*star) | — | Type: Integer

Index of a point. ||
|#

\* Mandatory parameter/option.

### set {#set}

```javascript
{ILinearRingGeometryAccess} set(index, coordinates)
```

Sets coordinates of the point with the specified index.

**Returns** self-reference.

**Parameters:**

#|
|| **Parameter** | **Default value** | **Description**  ||
|| [`index`](#set-param-index)[*](*star) | — | Type: Integer

Index of a point. ||
|| [`coordinates`](#set-param-coordinates)[*](*star) | — | Type: Number[]

Coordinates of a point. ||
|#

\* Mandatory parameter/option.

### setCoordinates {#setCoordinates}

```javascript
{ILinearRingGeometryAccess} setCoordinates(coordinates)
```

Sets an array of geometry coordinates.

**Returns** self-reference.

**Parameters:**

#|
|| **Parameter** | **Default value** | **Description**  ||
|| [`coordinates`](#setCoordinates-param-coordinates)[*](*star) | — | Type: Number[][]

Geometry coordinates. ||
|#

\* Mandatory parameter/option.

### setFillRule {#setFillRule}

```javascript
{ILinearRingGeometryAccess} setFillRule(fillRule)
```

Sets the contour fill rule.

**Returns** self-reference.

**Parameters:**

#|
|| **Parameter** | **Default value** | **Description**  ||
|| [`fillRule`](#setFillRule-param-fillRule)[*](*star) | — | Type: String

ID of the fill rule. ||
|#

\* Mandatory parameter/option.

### splice {#splice}

```javascript
{Number[][]} splice(index, number)
```

Deletes a defined number of points, starting from the specified index. New points can be added in place of the deleted ones. Coordinates of the new points can be passed as additional arguments after the "number" parameter.

**Returns** an array of coordinates of deleted points.

**Parameters:**

#|
|| **Parameter** | **Default value** | **Description**  ||
|| [`index`](#splice-param-index)[*](*star) | — | Type: Integer

The index to start from for removing and adding points. ||
|| [`number`](#splice-param-number)[*](*star) | — | Type: Integer

The number of deleted points. ||
|#

\* Mandatory parameter/option.

[*star]: Mandatory parameter/option.