@seasketch/geoprocessing
Version:
Geoprocessing and reporting framework for SeaSketch 2.0
27 lines (26 loc) • 1.49 kB
TypeScript
import { Metric, MetricDimension, StatsObject } from "../../types/index.js";
/**
* Converts an array of geoblaze raster StatsObject to an array of Metrics
* @param statsObjects
* @param sketchId
* @param extra
*/
export declare const rasterStatsToMetrics: (statsObjects: StatsObject[], options?: {
/** 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;
/** Properties to append to metric extra */
metricPartial?: Partial<Metric>;
truncate?: boolean;
/** If multi-band raster, metric property name that raster bands are organized. Defaults to groupId */
bandMetricProperty?: MetricDimension;
/** If multi-band raster, array of indexed by band number to assign to bandMetricsProperty ['mangroves','coral']. ['band 1','band 2] */
bandMetricValues?: string[];
/** 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[];
}) => Metric[];