UNPKG

@seasketch/geoprocessing

Version:

Geoprocessing and reporting framework for SeaSketch 2.0

47 lines (46 loc) 2.03 kB
import { z } from "zod"; /** * Represents a single class of data. Ties it to an underlying datasource, holds attributes used for displaying in user interfaces */ export declare const dataClassSchema: z.ZodObject<{ /** Unique identifier for class in project */ classId: z.ZodString; /** Optional datasource class key used to source classIds */ classKey: z.ZodOptional<z.ZodString>; /** Datasource for single data class */ datasourceId: z.ZodOptional<z.ZodString>; /** Name of class suitable for user display */ display: z.ZodString; /** Optional unique number used by some datasets (e.g. raster) to represent data class instead of string */ numericClassId: z.ZodOptional<z.ZodNumber>; /** Optional ID of map layer associated with this class */ layerId: z.ZodOptional<z.ZodString>; /** class level objective */ objectiveId: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { classId: string; display: string; datasourceId?: string | undefined; classKey?: string | undefined; numericClassId?: number | undefined; layerId?: string | undefined; objectiveId?: string | undefined; }, { classId: string; display: string; datasourceId?: string | undefined; classKey?: string | undefined; numericClassId?: number | undefined; layerId?: string | undefined; objectiveId?: string | undefined; }>; /** * Represents a group of data classes. * Used to access the data, and calcualte metrics based on them. * This interface is murky but it supports a variety of scenarios: * - Vector dataset with one feature class * - Vector dataset with multiple feature class, each with their own file datasource, and possibly only one layerId to display them all * - Vector dataset with multiple feature classes, all in one file datasource, each class with its own layerId * - Raster with multiple feature classes represented by unique integer values that map to class names */ export type DataClass = z.infer<typeof dataClassSchema>;