mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-15 00:04:00 -04:00
fix layer mapping in case direct use NOT in a model
This commit is contained in:
parent
d3144b97af
commit
9e2286ae98
@ -214,6 +214,12 @@ class RasterCalculator(QgisAlgorithm):
|
||||
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user