Skip to content
Snippets Groups Projects
Verified Commit 916fa7fb authored by David Hoese's avatar David Hoese
Browse files

Add restricted zoom levels to WMTS image layers

parent b6268ce3
No related branches found
No related tags found
No related merge requests found
Pipeline #10516 failed
......@@ -198,22 +198,11 @@
<tileset name="{{ plat }}_abi_{{ sector }}_l1b_{{ product }}">
<source>{{ plat }}_abi_{{ sector }}_l1b_{{ product }}</source>
<cache>disk</cache>
<!-- grid: the "name" attribute of a preconfigured <grid>
you can also use the following notation to limit the area that will be cached and served to clients:
<grid restricted_extent="-10 40 10 50">WGS84</grid>
this way is better than using a grid with a limited extent, as in this way the tiles that are already
cached are not invalidated should you want to modify the restricted extent in the future. When using
the restricted_extent attribute, you should give the corresponding information to the client that will
be using the service.
you can also limit the zoom levels that are cached/accessible by using the minzoom, maxzoom attributes.
NOTE: when adding a <grid> element, you *MUST* make sure that the source you have selected is able to
return images in the grid's srs.
-->
<!-- <grid restricted_extent="-10 40 10 50" minzoom="6" maxzoom="8">WGS84</grid>-->
<grid>grid_{{ plat }}_abi_radf</grid>
{% if product in zoom_levels %}
<grid minzoom="{{ zoom_levels[product][0] }}" maxzoom="{{ zoom_levels[product][1] }}">grid_{{ plat }}_abi_radf</grid>
{% else %}
<grid>grid_{{ plat }}_abi_radf</grid>
{% endif %}
<!-- metadata
optional metadata tags used for responding to GetCapabilities request.
......@@ -257,6 +246,7 @@
<source>{{ plat }}_abi_basemap</source>
<cache>disk</cache>
<grid>grid_{{ plat }}_abi_radf</grid>
<!-- <grid minzoom="0" maxzoom="4">grid_{{ plat }}_abi_radf</grid>-->
<metadata>
<title>CSPP Geo Geo2Grid Web Viewer - {{ PLATFORM_LONG_NAMES[plat] }} ABI</title>
<abstract>{{ PLATFORM_LONG_NAMES[plat] }} ABI Basemap tiles</abstract>
......
......@@ -55,6 +55,15 @@ IMAGE_FORMATS = defaultdict(lambda: 'rgba')
# IMAGE_FORMATS['C{:02d}'.format(i)] = 'gray'
ZOOM_LEVELS = defaultdict(lambda: (0, 7))
for ch_num in [4] + list(range(6, 17)):
ZOOM_LEVELS[f"C{ch_num:02d}"] = (0, 5)
ZOOM_LEVELS["C01"] = (0, 6)
ZOOM_LEVELS["C03"] = (0, 6)
ZOOM_LEVELS["C05"] = (0, 6)
ZOOM_LEVELS["C05"] = (0, 6)
def main():
import argparse
parser = argparse.ArgumentParser(description="Render mapcache template to complete mapcache config.")
......@@ -76,6 +85,7 @@ def main():
'image_autoexpire': image_autoexpire,
'basemap_autoexpire': basemap_autoexpire,
'IMAGE_FORMATS': IMAGE_FORMATS,
'zoom_levels': ZOOM_LEVELS,
}
with open(args.template_fn, 'r') as tmpl_file:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment