Skip to main content

datasetGeometryProperty()

datasetGeometryProperty<T>(dataset): keyof T

Extract the geometry property name directly from a dataset.

Type Parameters

T

T

The expected feature type with typed property keys

Parameters

dataset

AnyDataset

The dataset to extract geometry property from

Returns

keyof T

The geometry property name as a key of T

Remarks

Composed lens that navigates: dataset → metadata → geometryProperty

Example

type Feature = { id: number; location: Point };
const geomKey = datasetGeometryProperty<Feature>(dataset); // 'location'
const coords = feature[geomKey];