Skip to content
Permalink
Browse files

fix layer mapping in case direct use NOT in a model

  • Loading branch information
luipir committed Aug 27, 2018
1 parent d3144b9 commit 9e2286ae98b075ce8c50a3d0cbe3be6e4c8b0ee0
Showing with 6 additions and 0 deletions.
  1. +6 −0 python/plugins/processing/algs/qgis/RasterCalculator.py
@@ -214,6 +214,12 @@ def mappedNameToLayer(self, lyr, expression, layersDict, context):

nameToMap = lyr.source()

# check if nameToMap is a file
# TODO: what about URI eg for a COG?
if os.path.isfile(nameToMap):
# get only the name without extension and path of the file
nameToMap = os.path.splitext(os.path.basename(nameToMap))[0]

# check for layers directly added in the expression
if (nameToMap + "@") in expression:
layersDict[nameToMap] = lyr

0 comments on commit 9e2286a

Please sign in to comment.
You can’t perform that action at this time.