@seasketch/geoprocessing
Version:
Geoprocessing and reporting framework for SeaSketch 2.0
31 lines (30 loc) • 2.01 kB
TypeScript
import { Metric, MetricDimension } from "../types/index.js";
import { RasterStatsOptions } from "./geoblaze/index.js";
import { Georaster } from "geoblaze";
export interface OverlapRasterOptions extends RasterStatsOptions {
/** Optional metricId to be assigned. Don't use if you are calculating more than one stat because you won't be able to tell them apart */
metricId?: string;
/** Optional caller-provided prefix to add to metricId in addition to stat name e.g. 'coral' with metrics of 'sum', 'count', 'area' will generate metric IDs of 'coral-sum', 'coral-count', 'coral-area' */
metricIdPrefix?: string;
/** Truncates results to 6 digits, defaults to true */
truncate?: boolean;
/** If multi-band raster, metric property name that raster bands are organized by e.g. classID */
bandMetricProperty?: MetricDimension;
/** If multi-band raster, object mapping band number (starting with 0 index) to unique ID value eg. ( 0: 'mangroves', 1: 'coral' ). Defaults to 'band 1', 'band 2' */
bandMetricValues?: string[];
includeChildMetrics?: boolean;
/** If categorical raster, set to true */
categorical?: boolean;
/** If categorical raster, metric property name that categories are organized. Defaults to classId */
categoryMetricProperty?: MetricDimension;
/** If categorical raster, array of values to create metrics for */
categoryMetricValues?: string[];
}
/**
* Calculates summary metrics (stats/area) on given raster, optionally intersecting raster with provided feature (zonal statistics).
* If feature is a collection, then calculate metrics for each individual feature as well as the collection as a whole.
* This can be disabled with includeChildMetrics: false. Defaults to assuming a continuous raster but also supports categorical option
*/
export declare function rasterMetrics(
/** Cloud-optimized geotiff, loaded via loadCog or geoblaze.parse() */
raster: Georaster, options?: OverlapRasterOptions): Promise<Metric[]>;