-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Currently, the group-by functionality for dataset_category is driven automatically by extracting values from dataset labels:
const [groupBy, setGroupBy] = useState('');
useEffect(() => {
if (!groupBy && groupByOptions[0]) {
setGroupBy(groupByOptions[0]);
}
}, [groupByOptions]);In contrast, the group-by logic for feature type relies on the resolveFeatureType() function. However, this function skips feature type resolution if the dataset is marked as a raster:
if (dataset.layer_type === 'raster') {
return dataset;
}This means feature type inference is bypassed based on the layer_type, which assumes the layer_type is correctly pre-set by the user. This dependency introduces a potential risk of incorrect grouping behavior if the layer_type is missing or incorrectly set in the dataset metadata.
Proposed Improvement
We may need to revisit and improve the logic:
- Consider making feature type resolution more robust, even for raster layers.
- Add a fallback mechanism when
layer_typeis not defined or unreliable. - Optionally log or warn when skipping feature type resolution due to missing or invalid
layer_type.
Dataset Interface for Reference
export interface Dataset {
layer_id: string;
layer_type: LayerType;
display_name: string;
description: string;
default_style_name?: string;
ogc_service_url: string;
timestamps: string[];
unit?: string;
labels: {
dataset_category: string;
[key: string]: string;
};
}Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request