Using the QGIS Advanced Python Field Calculator, I am able to assign the new field a value from a feature an existing field using
value = <Attribute_1>. I run into a problem when I am using more complex code like the following used to calculate the absolute differences in azimuths:
diff = <Az_1> - <Az_2> absDiff = abs(diff) if absDiff == 180: value = absDiff elif absDiff < 180: value = diff elif <Az_1> > <Az_2>: value = absDiff - 360 else: value = 360 - absDiff
When I run the code through a compile and substitute the
Az_2 variables with integers, the code works, yet I get the following error when executing the model the code is a part of in QGIS:
TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'