Skip to content

Commit

Permalink
Only apply resampling to numeric rasters
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed May 21, 2024
1 parent 51da4da commit 8391894
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions felt/core/fsl_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down

0 comments on commit 8391894

Please sign in to comment.