From 2e8cd68532d7305d1911ad00f06622257cd1fe25 Mon Sep 17 00:00:00 2001 From: Benjamin Winkel Date: Wed, 24 Apr 2019 17:06:03 +0200 Subject: [PATCH] srtm: SrtmConf: fix cache_clear handling on download/server option changes --- pycraf/pathprof/srtm.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pycraf/pathprof/srtm.py b/pycraf/pathprof/srtm.py index c426f1e62..5fa718eae 100644 --- a/pycraf/pathprof/srtm.py +++ b/pycraf/pathprof/srtm.py @@ -238,16 +238,18 @@ def hook(cls, **kwargs): if kwargs['srtm_dir'] != cls.srtm_dir: get_tile_interpolator.cache_clear() - if 'download' in kwargs or 'server' in kwargs: + if 'download' in kwargs: # check if 'download' strategy was changed and clear cache # this is necessary, because missing tiles will lead to # zero heights in the tile cache (for that tile) and if user # later sets the option to download missing tiles, the reading # routine needs to run again - if ( - kwargs['download'] != cls.download or - kwargs['server'] != cls.server - ): + if kwargs['download'] != cls.download: + get_tile_interpolator.cache_clear() + + if 'server' in kwargs: + # dito + if kwargs['server'] != cls.server: get_tile_interpolator.cache_clear()