UNPKG

@seasketch/geoprocessing

Version:

Geoprocessing and reporting framework for SeaSketch 2.0

24 lines (23 loc) 1.34 kB
import { Geometry, Polygon, MultiPolygon, Feature, FeatureCollection, SketchGeometryTypes } from "../types/index.js"; /** Helper to convert a Feature or a FeatureCollection to a Feature array */ export declare function toFeatureArray(input: Feature | FeatureCollection): Feature<Geometry, import("geojson").GeoJsonProperties>[]; export declare function toFeaturePolygonArray(input: Feature<Polygon | MultiPolygon> | FeatureCollection<Polygon | MultiPolygon>): Feature<Polygon | MultiPolygon, import("geojson").GeoJsonProperties>[]; /** * Returns a Feature with given features geometry and properties. Reasonable defaults are given for properties not provided * Default geometry is a square from 0,0 to 1,1 */ export declare const genFeature: <G extends Geometry = SketchGeometryTypes>(options?: { feature?: Feature<G>; name?: string; id?: string; }) => Feature<G>; /** * Given array of features, return a feature collection with given properties. * Generates reasonable default values for any properties not passed in * The geometry type of the returned collection will match the one passed in * Properties of features are retained */ export declare const genFeatureCollection: <G extends Geometry = SketchGeometryTypes>(features: Feature<G>[], options?: { name?: string; id?: string; }) => FeatureCollection<G>;