From 8391894c08bee7e2adc064b76161200d95bc5b9a Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Tue, 21 May 2024 10:01:00 +1000 Subject: [PATCH] Only apply resampling to numeric rasters --- felt/core/fsl_converter.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/felt/core/fsl_converter.py b/felt/core/fsl_converter.py index 6ef2197..c58f0da 100644 --- a/felt/core/fsl_converter.py +++ b/felt/core/fsl_converter.py @@ -1540,16 +1540,18 @@ def raster_layer_to_fsl( if not fsl: return None - is_early_resampling = (layer.resamplingStage() == - QgsRasterPipe.ResamplingStage.Provider) - if (is_early_resampling and - (layer.dataProvider().zoomedInResamplingMethod() != - QgsRasterDataProvider.ResamplingMethod.Nearest or - layer.dataProvider().zoomedOutResamplingMethod() != - QgsRasterDataProvider.ResamplingMethod.Nearest)): - fsl['config']['rasterResampling'] = "linear" - else: - fsl['config']['rasterResampling'] = "nearest" + # resampling only applies to numeric rasters + if fsl.get('type') == 'numeric': + is_early_resampling = (layer.resamplingStage() == + QgsRasterPipe.ResamplingStage.Provider) + if (is_early_resampling and + (layer.dataProvider().zoomedInResamplingMethod() != + QgsRasterDataProvider.ResamplingMethod.Nearest or + layer.dataProvider().zoomedOutResamplingMethod() != + QgsRasterDataProvider.ResamplingMethod.Nearest)): + fsl['config']['rasterResampling'] = "linear" + else: + fsl['config']['rasterResampling'] = "nearest" if layer.hasScaleBasedVisibility(): if layer.minimumScale():