@seasketch/geoprocessing
Version:
Geoprocessing and reporting framework for SeaSketch 2.0
33 lines (32 loc) • 1.36 kB
TypeScript
import { BBox, Feature, FeatureCollection, Geometry } from "../types/index.js";
import "./fetchPolyfill.js";
export interface FgBoundingBox {
minX: number;
maxX: number;
minY: number;
maxY: number;
}
export declare function fgBoundingBox(box: BBox): FgBoundingBox;
/**
* Fetch features from flatgeobuf at url that intersect with bounding box
* Retries up to 3 times if fetch fails in error
* @param url url of flatgeobuf file
* @param bbox optional bounding box to fetch features that intersect with
* @returns feature array
* @deprecated Use `loadFgb` instead.
*/
export declare function fgbFetchAll<F extends Feature<Geometry>>(url: string, box?: BBox): Promise<F[]>;
/**
* Fetch features from flatgeobuf at url that intersect with bounding box
* Retries up to 3 times if fetch fails in error
* @param url url of flatgeobuf file
* @param bbox optional bounding box to fetch features that intersect with
* @returns feature array
*/
export declare function loadFgb<F extends Feature<Geometry>>(url: string, bbox?: BBox): Promise<F[]>;
/**
* Synchronously load a flatgeobuf file from disk. Assumed to be in WGS84 EPSG:4326 projection
* @param path path to flatgeobuf file
* @returns feature collection of features from disk
*/
export declare function loadFgbFromDisk<G extends Geometry>(path: string): FeatureCollection<G>;