export type GeometryTypes = 'Point' | 'LineString' | 'Polygon' | 'MultiPoint' | 'MultiLineString' | 'MultiPolygon' | 'GeometryCollection'; export type CollectionTypes = 'FeatureCollection' | 'GeometryCollection'; export type Types = 'Feature' | GeometryTypes | CollectionTypes; export type BBox2d = [number, number, number, number]; export type BBox3d = [number, number, number, number, number, number]; export type BBox = BBox2d | BBox3d; export type Id = string | number; export type Position = [number, number] | [number, number, number]; export type Properties = { [name: string]: any; } | null; export type Geometries = Point | LineString | Polygon | MultiPoint | MultiLineString | MultiPolygon; export interface GeoJSONObject { type: string; bbox?: BBox; } export interface GeometryObject extends GeoJSONObject { type: GeometryTypes; } export interface Geometry extends GeoJSONObject { coordinates: Position | Position[] | Position[][] | Position[][][]; } export interface Point extends GeometryObject { type: 'Point'; coordinates: Position; } export interface MultiPoint extends GeometryObject { type: 'MultiPoint'; coordinates: Position[]; } export interface LineString extends GeometryObject { type: 'LineString'; coordinates: Position[]; } export interface MultiLineString extends GeometryObject { type: 'MultiLineString'; coordinates: Position[][]; } export interface Polygon extends GeometryObject { type: 'Polygon'; coordinates: Position[][]; } export interface MultiPolygon extends GeometryObject { type: 'MultiPolygon'; coordinates: Position[][][]; } export interface GeometryCollection extends GeometryObject { type: 'GeometryCollection'; geometries: Array; } export interface Feature extends GeoJSONObject { type: 'Feature'; geometry: G; id?: Id; properties: P; } export interface FeatureCollection extends GeoJSONObject { type: 'FeatureCollection'; features: Array>; } export type GeoJSON = Feature | FeatureCollection | Geometry | GeometryCollection;