Skip to content

Commit

Permalink
Merge pull request #485 from GeoscienceAustralia/hltc-style-fix
Browse files Browse the repository at this point in the history
fix hltc styles
  • Loading branch information
mergify[bot] authored Jan 8, 2020
2 parents 83fac9a + 45d876a commit 42841fc
Showing 1 changed file with 29 additions and 13 deletions.
42 changes: 29 additions & 13 deletions prod/services/wms/ows/ows_cfg.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Migration of wms_cfg.py. As at commit c44c5e61c7fb9

import copy
from functools import partial
# Reusable Chunks 1. Resource limit configurations

reslim_landsat = {
Expand Down Expand Up @@ -4688,6 +4689,31 @@
]
}

##############################################################################################
#
# Rescale styles for tide layers
#
##############################################################################################

ls_style_list = [
style_ls_simple_rgb,
style_ls_irg, style_ls_ndvi, style_ls_ndwi, style_ls_mndwi,
style_sentinel_pure_blue, style_ls_pure_green, style_ls_pure_red,
style_ls_pure_nir, style_ls_pure_swir1, style_ls_pure_swir2,
]

# HACK: Move this to a utils to allow style reusability
def swap_scale(new_scale : list, style : dict):
if "scale_range" in style:
new_style = copy.copy(style)
new_style["scale_range"] = new_scale
return new_style
return style

swap_scale_p = partial(swap_scale, [0.0,0.3])

tide_style_list = list([swap_scale_p(s) for s in ls_style_list])

style_insar_velocity = {
"name": "insar_velocity",
"title": "InSAR Displacement Velocity",
Expand Down Expand Up @@ -6398,12 +6424,7 @@
},
"styling": {
"default_style": "simple_rgb",
"styles": [
style_ls_simple_rgb,
style_ls_irg, style_ls_ndvi, style_ls_ndwi, style_ls_mndwi,
style_sentinel_pure_blue, style_ls_pure_green, style_ls_pure_red,
style_ls_pure_nir, style_ls_pure_swir1, style_ls_pure_swir2,
]
"styles": tide_style_list
}

},
Expand Down Expand Up @@ -6448,12 +6469,7 @@
},
"styling": {
"default_style": "simple_rgb",
"styles": [
style_ls_simple_rgb,
style_ls_irg, style_ls_ndvi, style_ls_ndwi, style_ls_mndwi,
style_sentinel_pure_blue, style_ls_pure_green, style_ls_pure_red,
style_ls_pure_nir, style_ls_pure_swir1, style_ls_pure_swir2,
]
"styles": tide_style_list
}
},
]
Expand Down

0 comments on commit 42841fc

Please sign in to comment.