You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I set up some of the configs to support biome filters using the table but some issues will still need to be resolved
The names being displayed show WWF codes (WWF_TEW_BIOME_*) instead of the human readable names (Tundra).
After applying a biome filter, points on the map of different biomes appear.
Expected behavior
Display human readable names instead of WWF codes
After applying a biome filters, only show points on the map related to filtered biome
Steps to reproduce
Open filters and apply biome filter.
Modules involved
Query builder
Ecology module
System information
No response
Additional context
It would be better to include the human readable name in the materialized view instead of mapping it on the frontend. This is because the filters are stored in app state and having the same value for display text and sql value would be consistent with behaviour of all other filters.
I'm not sure if the materialized view is easy to update, but I started drafting what the query would be:
CREATE MATERIALIZED VIEW IF NOT EXISTS public.bgl_gm4326_gp4326
TABLESPACE pg_default
ASSELECTbiosample_geographical_location.accession,
biosample_geographical_location.attribute_name,
biosample_geographical_location.attribute_value,
biosample_geographical_location.lat_lon,
biosample_geographical_location.palm_virome,
bgl_ll_3_gm4326_gp4326.gm4326_id,
bgl_ll_3_gm4326_gp4326.gp4326_wwf_tew_id,
CASE
WHEN bgl_ll_3_gm4326_gp4326.gp4326_wwf_tew_id='WWF_TEW_BIOME_01' THEN 'Tropical & Subtropical Moist Broadleaf Forests'
WHEN bgl_ll_3_gm4326_gp4326.gp4326_wwf_tew_id='WWF_TEW_BIOME_02' THEN 'Tropical & Subtropical Dry Broadleaf Forests'
WHEN bgl_ll_3_gm4326_gp4326.gp4326_wwf_tew_id='WWF_TEW_BIOME_03' THEN 'Tropical & Subtropical Coniferous Forests'
WHEN bgl_ll_3_gm4326_gp4326.gp4326_wwf_tew_id='WWF_TEW_BIOME_04' THEN 'Temperate Broadleaf & Mixed Forests'
WHEN bgl_ll_3_gm4326_gp4326.gp4326_wwf_tew_id='WWF_TEW_BIOME_05' THEN 'Temperate Conifer Forests'
WHEN bgl_ll_3_gm4326_gp4326.gp4326_wwf_tew_id='WWF_TEW_BIOME_06' THEN 'Boreal Forests/Taiga'
WHEN bgl_ll_3_gm4326_gp4326.gp4326_wwf_tew_id='WWF_TEW_BIOME_07' THEN 'Tropical & Subtropical Grasslands, Savannas & Shrublands'
WHEN bgl_ll_3_gm4326_gp4326.gp4326_wwf_tew_id='WWF_TEW_BIOME_08' THEN 'Temperate Grasslands, Savannas & Shrublands'
WHEN bgl_ll_3_gm4326_gp4326.gp4326_wwf_tew_id='WWF_TEW_BIOME_09' THEN 'Flooded Grasslands & Savannas'
WHEN bgl_ll_3_gm4326_gp4326.gp4326_wwf_tew_id='WWF_TEW_BIOME_10' THEN 'Montane Grasslands & Shrublands'
WHEN bgl_ll_3_gm4326_gp4326.gp4326_wwf_tew_id='WWF_TEW_BIOME_11' THEN 'Tundra'
WHEN bgl_ll_3_gm4326_gp4326.gp4326_wwf_tew_id='WWF_TEW_BIOME_12' THEN 'Mediterranean Forests, Woodlands & Scrub'
WHEN bgl_ll_3_gm4326_gp4326.gp4326_wwf_tew_id='WWF_TEW_BIOME_13' THEN 'Deserts & Xeric Shrublands'
WHEN bgl_ll_3_gm4326_gp4326.gp4326_wwf_tew_id='WWF_TEW_BIOME_14' THEN 'Mangroves'
WHEN bgl_ll_3_gm4326_gp4326.gp4326_wwf_tew_id='WWF_TEW_BIOME_98' THEN 'Ocean'
WHEN bgl_ll_3_gm4326_gp4326.gp4326_wwf_tew_id='WWF_TEW_BIOME_99' THEN 'Ocean'
ELSE 'N/A'
END AS biome_name
FROM biosample_geographical_location
LEFT JOIN bgl_ll_3_gm4326_gp4326 ONbiosample_geographical_location.attribute_value=bgl_ll_3_gm4326_gp4326.attribute_value
WITH DATA;
The text was updated successfully, but these errors were encountered:
Describe the bug
I set up some of the configs to support biome filters using the table but some issues will still need to be resolved
WWF_TEW_BIOME_*
) instead of the human readable names (Tundra
).Expected behavior
Steps to reproduce
Open filters and apply biome filter.
Modules involved
System information
No response
Additional context
It would be better to include the human readable name in the materialized view instead of mapping it on the frontend. This is because the filters are stored in app state and having the same value for display text and sql value would be consistent with behaviour of all other filters.
I'm not sure if the materialized view is easy to update, but I started drafting what the query would be:
The text was updated successfully, but these errors were encountered: