Skip to content

Commit 42841fc

Browse files
authored
Merge pull request #485 from GeoscienceAustralia/hltc-style-fix
fix hltc styles
2 parents 83fac9a + 45d876a commit 42841fc

File tree

1 file changed

+29
-13
lines changed

1 file changed

+29
-13
lines changed

prod/services/wms/ows/ows_cfg.py

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Migration of wms_cfg.py. As at commit c44c5e61c7fb9
2-
2+
import copy
3+
from functools import partial
34
# Reusable Chunks 1. Resource limit configurations
45

56
reslim_landsat = {
@@ -4688,6 +4689,31 @@
46884689
]
46894690
}
46904691

4692+
##############################################################################################
4693+
#
4694+
# Rescale styles for tide layers
4695+
#
4696+
##############################################################################################
4697+
4698+
ls_style_list = [
4699+
style_ls_simple_rgb,
4700+
style_ls_irg, style_ls_ndvi, style_ls_ndwi, style_ls_mndwi,
4701+
style_sentinel_pure_blue, style_ls_pure_green, style_ls_pure_red,
4702+
style_ls_pure_nir, style_ls_pure_swir1, style_ls_pure_swir2,
4703+
]
4704+
4705+
# HACK: Move this to a utils to allow style reusability
4706+
def swap_scale(new_scale : list, style : dict):
4707+
if "scale_range" in style:
4708+
new_style = copy.copy(style)
4709+
new_style["scale_range"] = new_scale
4710+
return new_style
4711+
return style
4712+
4713+
swap_scale_p = partial(swap_scale, [0.0,0.3])
4714+
4715+
tide_style_list = list([swap_scale_p(s) for s in ls_style_list])
4716+
46914717
style_insar_velocity = {
46924718
"name": "insar_velocity",
46934719
"title": "InSAR Displacement Velocity",
@@ -6398,12 +6424,7 @@
63986424
},
63996425
"styling": {
64006426
"default_style": "simple_rgb",
6401-
"styles": [
6402-
style_ls_simple_rgb,
6403-
style_ls_irg, style_ls_ndvi, style_ls_ndwi, style_ls_mndwi,
6404-
style_sentinel_pure_blue, style_ls_pure_green, style_ls_pure_red,
6405-
style_ls_pure_nir, style_ls_pure_swir1, style_ls_pure_swir2,
6406-
]
6427+
"styles": tide_style_list
64076428
}
64086429

64096430
},
@@ -6448,12 +6469,7 @@
64486469
},
64496470
"styling": {
64506471
"default_style": "simple_rgb",
6451-
"styles": [
6452-
style_ls_simple_rgb,
6453-
style_ls_irg, style_ls_ndvi, style_ls_ndwi, style_ls_mndwi,
6454-
style_sentinel_pure_blue, style_ls_pure_green, style_ls_pure_red,
6455-
style_ls_pure_nir, style_ls_pure_swir1, style_ls_pure_swir2,
6456-
]
6472+
"styles": tide_style_list
64576473
}
64586474
},
64596475
]

0 commit comments

Comments
 (0)