"""WMS LifeWatch — built-in companion plugin.
Loads LifeWatch high-resolution land-cover raster WMS layers (2006–2022)
as background layers in the active WolfMapViewer.
"""
from wolfhece._builtin_plugins.wms_base import WmsLayerCompanion
from wolfhece.PyTranslate import _
[docs]
class WmsLifeWatchCompanion(WmsLayerCompanion):
"""Companion plugin that loads LifeWatch land-cover WMS layers."""
[docs]
def _do_load_layers(self) -> None:
from wolfhece.wolf_texture import imagetexture
v = self.proxy._viewer
xmin = xmax = ymin = ymax = 0
lifewatch = {
'LW_ecotopes_lc_hr_raster': {
'2006': '2006',
'2010': '2010',
'2015': '2015',
'2018': '2018',
'2019': '2019',
'2020': '2020',
'2021': '2021',
'2022': '2022',
},
}
for k, item in lifewatch.items():
for m, subitem in item.items():
self._add_wms('wmsback',
imagetexture('LanCover', m, k, subitem,
v, xmin, xmax, ymin, ymax, -99999, 1024,
LifeWatch=True),
'LifeWatch LC' + m)
self.proxy.set_status(_('LifeWatch WMS layers loaded.'))