# LayerFeature

***

A LayerFeature is a single geographical item in a layer.

It is intended to be a lightweight object that contains the properties of a feature, but not the geometry. It is returned by methods like [FeltController.getRenderedFeatures](https://developers.felt.com/js-sdk-api-reference/layerscontroller#getrenderedfeatures) and [FeltController.getFeature](https://developers.felt.com/js-sdk-api-reference/layerscontroller#getfeature), and as part of the methods in the [SelectionController](https://developers.felt.com/js-sdk-api-reference/selection/selectioncontroller)

The geometry can be obtained via the [FeltController.getGeoJsonFeature](https://developers.felt.com/js-sdk-api-reference/layerscontroller#getgeojsonfeature) method, which returns a [GeoJsonFeature](https://developers.felt.com/js-sdk-api-reference/shared/geojsonfeature) object.

## Properties

### id

> **id**: `string` | `number`

The identifier of the feature, unique within the layer.

***

### isDeterministicId

> **isDeterministicId**: `boolean`

Whether the id is deterministic.

#### Remarks

If the id is deterministic, it means that the id can be used to reference the feature in the layer and therefore in all the SDK feature-related methods.

When the id is not deterministic, the feature cannot be referenced on SDK methods like [FeltController.getFeature](https://developers.felt.com/js-sdk-api-reference/layerscontroller#getfeature) or [SelectionController.selectFeature](https://developers.felt.com/js-sdk-api-reference/selection/selectioncontroller#selectfeature).

For layers created and processed on Felt servers, the feature IDs are deterministic because Felt ensures every feature is correctly identified in vector tiles. This cannot be guaranteed for layers created using a GeoJSON source on the SDK (see [LayersController.createLayersFromGeoJson](https://developers.felt.com/js-sdk-api-reference/layerscontroller#createlayersfromgeojson)) where the ID will only be deterministic if GeoJSON features have an `id` property.

***

### layerId

> **layerId**: `string`

The identifier of the layer that the feature belongs to.

***

### geometryType

> **geometryType**: `"Polygon"` | `"MultiPolygon"` | `"LineString"` | `"MultiLineString"` | `"Point"` | `"MultiPoint"` | `string` & {}

The type of geometry of the feature.

#### Remarks

Because LayerFeatures can be read from tiled features, it's possible that this `geometryType` won't match the `geometry.type` of the [GeoJsonFeature](https://developers.felt.com/js-sdk-api-reference/shared/geojsonfeature) returned by [FeltController.getGeoJsonFeature](https://developers.felt.com/js-sdk-api-reference/layerscontroller#getgeojsonfeature).

For example, this may return `LineString` but the full feature is a `MultiLineString`, or, similarly `Polygon` here may be a `MultiPolygon` in the full feature.

As a result, you should treat this property as being indicative only.

***

### bbox

> **bbox**: `undefined` | \[`number`, `number`, `number`, `number`]

The bounding box of the feature.

#### Remarks

Because LayerFeatures can be read from tiled features and considering that feature geometry can go through multiple tiles, it's possible that this is not the complete bounding box of the feature.

***

### properties

> **properties**: [`GeoJsonProperties`](https://developers.felt.com/js-sdk-api-reference/shared/geojsonproperties)

The properties of the feature, as a bag of attributes.
