UNPKG

@seasketch/geoprocessing

Version:

Geoprocessing and reporting framework for SeaSketch 2.0

48 lines (47 loc) 3.17 kB
import { ExternalVectorDatasource, InternalVectorDatasource, Feature, VectorDatasource, BBox, SketchCollection, Sketch } from "../types/index.js"; import { LineString, MultiLineString, MultiPoint, MultiPolygon, Point, Polygon } from "geojson"; /** Specify one or more literal values for one or more vector Feature properties */ export interface VectorPropertyFilter { property: string; values: (string | number)[]; } export interface GetDatasourceFeaturesOptions { /** Fetches features overlapping with bounding box */ bbox?: BBox; /** Filter features by property having one or more specific values */ propertyFilter?: VectorPropertyFilter; /** Provide if you have subdivided dataset and want to rebuild (union) subdivided polygons based on having same value for this property name */ unionProperty?: string; /** Fetches features overlapping with sketch bounding box, can be more precise than passing single bounding box */ sketch?: Sketch | SketchCollection; } /** * Returns features for a variety of vector datasources and formats, with additional filter options */ /** * Fetches and returns features for a given datasource supporting a variety of formats/clients * @param datasource the datasource to fetch features from * @param url the url of the datasource * @param options.bbox fetch features overlapping with bounding box * @param options.propertyFilter filter features by property having one or more specific values * @param options.unionProperty provide if you have subdivided dataset and want to rebuild (union) subdivided polygons based on having same value for this property name * @param options.sketch fetch features overlapping with sketch bounding box, can be more precise than passing single bounding box * @returns feature array */ export declare function getDatasourceFeatures<G extends Point | MultiPoint | LineString | MultiLineString | Polygon | MultiPolygon>(datasource: InternalVectorDatasource | ExternalVectorDatasource | VectorDatasource, /** url of datasource */ url: string, options?: GetDatasourceFeaturesOptions): Promise<Feature<G>[]>; /** * Fetches and returns features for a given datasource supporting a variety of formats/clients * @param datasource the datasource to fetch features from * @param url the url of the datasource * @param options.bbox fetch features overlapping with bounding box * @param options.propertyFilter filter features by property having one or more specific values * @param options.unionProperty provide if you have subdivided dataset and want to rebuild (union) subdivided polygons based on having same value for this property name * @param options.sketch fetch features overlapping with sketch bounding box, can be more precise than passing single bounding box * @returns feature array * @deprecated use getDatasourceFeatures instead */ export declare function getFeatures<G extends Point | MultiPoint | LineString | MultiLineString | Polygon | MultiPolygon>(datasource: InternalVectorDatasource | ExternalVectorDatasource | VectorDatasource, /** url of datasource */ url: string, options?: GetDatasourceFeaturesOptions): Promise<Feature<G>[]>;