Skip to main content
Version: 7.0.0

OverlapRasterOptions

options accepted by rasterStats

Extends​

Properties​

bandMetricProperty?​

optional bandMetricProperty:
| "classId"
| "metricId"
| "geographyId"
| "sketchId"
| "groupId";

If multi-band raster, metric property name that raster bands are organized by e.g. classID


bandMetricValues?​

optional bandMetricValues: string[];

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'


categorical?​

optional categorical: boolean;

If categorical raster, set to true

Overrides​

RasterStatsOptions.categorical


categoryMetricProperty?​

optional categoryMetricProperty:
| "classId"
| "metricId"
| "geographyId"
| "sketchId"
| "groupId";

If categorical raster, metric property name that categories are organized. Defaults to classId

Overrides​

RasterStatsOptions.categoryMetricProperty


categoryMetricValues?​

optional categoryMetricValues: string[];

If categorical raster, array of values to create metrics for

Overrides​

RasterStatsOptions.categoryMetricValues


chunked?​

optional chunked: boolean;

Whether or not to chunk calculations

Inherited from​

RasterStatsOptions.chunked


feature?​

optional feature: FeatureCollection<Polygon | MultiPolygon, GeoJsonProperties> | Feature<Polygon | MultiPolygon, GeoJsonProperties> | SketchCollection<Polygon | MultiPolygon> | Sketch<Polygon | MultiPolygon>;

single sketch or sketch collection filter to overlap with raster when calculating metrics.

Inherited from​

RasterStatsOptions.feature


filter()?​

optional filter: (index, value) => boolean;

Filter function to ignore raster values in stat calc

Parameters​

ParameterType
indexnumber
valuenumber

Returns​

boolean

Inherited from​

RasterStatsOptions.filter


filterFn()?​

optional filterFn: (cellValue) => boolean;

undocumented filter function (how different from filter option above?), for example a => a > 0 will filter out pixels greater than zero such that 'valid' is number of valid pixels greater than 0

Parameters​

ParameterType
cellValuenumber

Returns​

boolean

Inherited from​

RasterStatsOptions.filterFn


includeChildMetrics?​

optional includeChildMetrics: boolean;

metricId?​

optional metricId: string;

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


metricIdPrefix?​

optional metricIdPrefix: 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'


noData?​

optional noData: number;

Override nodata value, which is ignored in calculations

Inherited from​

RasterStatsOptions.noData


numBands?​

optional numBands: number;

Optional number of bands in the raster, defaults to 1, used to initialize zero values

Inherited from​

RasterStatsOptions.numBands


stats?​

optional stats: string[];

Stats to calculate

Inherited from​

RasterStatsOptions.stats


truncate?​

optional truncate: boolean;

Truncates results to 6 digits, defaults to true