UNPKG

@seasketch/geoprocessing

Version:

Geoprocessing and reporting framework for SeaSketch 2.0

49 lines (48 loc) 2.48 kB
import { BBox, Sketch, SketchCollection } from "../types/index.js"; import { Feature, Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon } from "geojson"; /** * Loads features from a FlatGeobuf referenced by URL, which intersect the * bounding boxes of each individual sketch in a SketchCollection, or a single * Sketch. * * In the case of a SketchCollection, it is possible that duplicate features may * be fetched in the case of overlapping bounding boxes or very large features * that span multiple bounding boxes. This function will de-dupe those features. * The caller can * provide a uniqueIdProperty to de-dupe features (faster), otherwise a hash of * the feature coordinates will be used (slower). * * If uniqueIdProperty is not provided, there is the potential for elimination * of features that are geometrically identical but have different properties. * * @param sketch Sketch or SketchCollection * @param fgbUrl FlatGeobuf location * @param options.uniqueIdProperty name of unique ID property to de-dupe * features * @returns array of Features */ export declare function getFeaturesForSketchBBoxes<G extends Point | MultiPoint | LineString | MultiLineString | Polygon | MultiPolygon>(sketch: Sketch | SketchCollection, fgbUrl: string, options?: { uniqueIdProperty?: string; }): Promise<Feature<G>[]>; /** * Loads features from a FlatGeobuf referenced by URL, which intersect the * bounding boxes. Deduplicates features given uniqueIdProperty (faster) or * using md5 hash of feature coordinates (slower). * * It is possible that duplicate features may be fetched in the case of * overlapping bounding boxes. This function will de-dupe those features. The caller can * provide a uniqueIdProperty to de-dupe features (faster), otherwise a hash of * the feature coordinates will be used (slower). * * If uniqueIdProperty is not provided, there is the potential for elimination * of features that are geometrically identical but have different properties. * * @param bboxes the bounding boxes to fetch features for * @param fgbUrl the URL of the FlatGeobuf file * @param options.uniqueIdProperty name of unique ID property to de-dupe * features * @returns array of Features */ export declare function getFeaturesForBBoxes<G extends Point | MultiPoint | LineString | MultiLineString | Polygon | MultiPolygon>(bboxes: BBox[], fgbUrl: string, options?: { uniqueIdProperty?: string; }): Promise<Feature<G>[]>;