Skip to main content
Tweeted twitter.com/StackGIS/status/940182477074849792
edited tags
Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345
Copy edited (e.g. ref. <http://en.wikipedia.org/wiki/Python_%28programming_language%29>).
Source Link

Check if feature attribute is empty in QGIS with pythonPython

I want my pythonPython script to do something when 2two feature attribute values are None at the same time. 

So I made this ifif statement: if feature["Name"] and feature["Zon"] is None:, but the code stops there and doesn't continue. Before the ifif statement I print both feature attribute values and get the following: (None, None). So the code should theoretically work, but it doesn't. What am I missing?

Check if feature attribute is empty in QGIS with python

I want my python script to do something when 2 feature attribute values are None at the same time. So I made this if statement: if feature["Name"] and feature["Zon"] is None: but the code stops there and doesn't continue. Before the if statement I print both feature attribute values and get the following: (None, None). So the code should theoretically work but it doesn't. What am I missing?

Check if feature attribute is empty in QGIS with Python

I want my Python script to do something when two feature attribute values are None at the same time. 

So I made this if statement: if feature["Name"] and feature["Zon"] is None:, but the code stops there and doesn't continue. Before the if statement I print both feature attribute values and get the following: (None, None). So the code should theoretically work, but it doesn't. What am I missing?

Source Link
Blinxen
  • 723
  • 6
  • 22

Check if feature attribute is empty in QGIS with python

I want my python script to do something when 2 feature attribute values are None at the same time. So I made this if statement: if feature["Name"] and feature["Zon"] is None: but the code stops there and doesn't continue. Before the if statement I print both feature attribute values and get the following: (None, None). So the code should theoretically work but it doesn't. What am I missing?