UNPKG

kepler.gl

Version:

kepler.gl is a webgl based application to visualize large scale location data in the browser

79 lines (78 loc) 2.95 kB
import { Feature, BBox } from 'geojson'; import { BinaryFeatureCollection } from '@loaders.gl/schema'; import { DataContainerInterface } from '@kepler.gl/utils'; import { LayerColumns, ProtoDatasetField } from '@kepler.gl/types'; import { KeplerTable } from '@kepler.gl/table'; import { GeojsonLayerMetaProps } from '../layer-utils'; import { LayerBaseConfig } from '../base-layer'; export declare type GetFeature = (d: any) => Feature; export declare type GeojsonDataMaps = (Feature | BinaryFeatureCollection | null)[]; export declare type GeojsonPointDataMaps = (number[] | number[][] | null)[]; export declare const COLUMN_MODE_GEOJSON = "geojson"; export declare enum FeatureTypes { Point = "Point", MultiPoint = "MultiPoint", LineString = "LineString", MultiLineString = "MultiLineString", Polygon = "Polygon", MultiPolygon = "MultiPolygon" } /** * Returns true if the field has geoarrow extension. * @param geoField A field to test. * @returns */ export declare function fieldIsGeoArrow(geoField?: ProtoDatasetField | null): boolean; export declare function parseGeoJsonRawFeature(rawFeature: unknown): Feature | null; export declare function getGeojsonLayerMeta({ dataContainer, getFeature, config }: { dataContainer: DataContainerInterface; getFeature: GetFeature; config: LayerBaseConfig; }): GeojsonLayerMetaProps; /** * Parse raw data to GeoJson feature */ export declare function getGeojsonDataMaps(dataContainer: DataContainerInterface, getFeature: GetFeature): GeojsonDataMaps; /** * Parse raw data to GeoJson point feature coordinates */ export declare function getGeojsonPointDataMaps(dataContainer: DataContainerInterface, getFeature: GetFeature): GeojsonPointDataMaps; /** * Get geojson bounds */ export declare function getGeojsonBounds(features?: GeojsonDataMaps): BBox | null; export declare const featureToDeckGlGeoType: { Point: string; MultiPoint: string; LineString: string; MultiLineString: string; Polygon: string; MultiPolygon: string; }; export declare type DeckGlGeoTypes = { point: boolean; line: boolean; polygon: boolean; }; /** * Parse geojson from string */ export declare function getGeojsonFeatureTypes(allFeatures: GeojsonDataMaps): DeckGlGeoTypes; export declare function groupColumnsAsGeoJson(dataContainer: DataContainerInterface, columns: LayerColumns, sortByColumn?: string): Feature[]; /** * Find id / ts / lat / lng columns from a table and assign it to layer columns */ export declare function detectTableColumns(dataset: KeplerTable, layerColumns: LayerColumns, sortBy?: string): { columns: { geojson: { value: null; fieldIdx: number; }; id: { value: any; fieldIdx: any; }; }; label: any; } | null; export declare function applyFiltersToTableColumns(dataset: KeplerTable, dataToFeature: GeojsonDataMaps): GeojsonDataMaps;