When I try to calculate a new field. I receive the following error:
idx = self.layer.fieldNameIndex(attributeName) AttributeError: 'QgsVectorLayer' object has no attribute 'fieldNameIndex'
What´s the problem? I'm using QGIS 3.0.1 64x in windows.
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.Sign up to join this community
You need to access it via the QgsVectorDataProvider::fieldNameIndex method:
idx = self.layer.dataProvider().fieldNameIndex(attributeName)