aboutsummaryrefslogtreecommitdiffstats
path: root/common.py
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2024-06-08 00:52:54 +0200
committerGuilhem Moulin <guilhem@fripost.org>2024-06-08 00:57:03 +0200
commitb29079ab12087f3fdd1cbbd209e205f205aaf267 (patch)
treea4ed7e78f377b52545552d2cc1f2bb39aebb03d5 /common.py
parent7de8d3ae12486c5ea06557414047e7e37a2a391a (diff)
load_config(): Fail if an extent is set while no SRS is.
The configured extent is always relative to the configured SRS.
Diffstat (limited to 'common.py')
-rw-r--r--common.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/common.py b/common.py
index b46840f..67ab208 100644
--- a/common.py
+++ b/common.py
@@ -135,6 +135,14 @@ def load_config(path=None, groupnames=None):
layers = { name: layers[name] for name in layernames }
config['layers'] = layers
+
+ extent = config.get('extent', None)
+ if extent is not None:
+ if isinstance(extent, list):
+ config['extent'] = tuple(extent)
+ if config.get('SRS', None) is None:
+ raise Exception('Configured extent without SRS')
+
sys.modules[__name__].config = config
def format_bytes(n):