feat: add cross-domain Mol data profile
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import type { ThematicRasterSelectionResponse, VectorSelectionResponse } from '../types'
|
||||
|
||||
export function thematicRasterImageUrl(projectId: string, datasetId: string): string {
|
||||
return `/api/v1/projects/${projectId}/datasets/${datasetId}/raster/thematic/image`
|
||||
}
|
||||
|
||||
export function thematicRasterSelectionToMapSelection(result: ThematicRasterSelectionResponse): VectorSelectionResponse {
|
||||
return {
|
||||
selection_bbox: result.selection_bbox,
|
||||
selection_area_id: result.selection_area_id,
|
||||
feature_count: result.valid_cell_count,
|
||||
total_feature_count: result.valid_cell_count,
|
||||
limit: 0,
|
||||
truncated: false,
|
||||
geojson: { type: 'FeatureCollection', features: [] },
|
||||
summary: {
|
||||
...result.summary,
|
||||
feature_count: result.valid_cell_count,
|
||||
is_estimate: true,
|
||||
warning: result.limitation_message,
|
||||
metrics: result.summary.metrics.map((metric) => ({
|
||||
...metric,
|
||||
is_estimate: metric.is_estimate ?? true,
|
||||
})),
|
||||
},
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user