I am trying to write a python plugin for QGIS that can convert three vector layers into an object File for an urban climate model. Unfortunately I am stuck again with a possibly easy question:
How can I save a column from the attribute table of a vector layer to a variable (for later use)?
For example, I have a layer with buildings (build
) with the hight of the buildings in field 35. I want to save all the building hights into a variable (theINPolyHField
).
I tried the following:
build = canvas.layer(2)
build_prov = build.dataProvider()
theINPolyHField = build_prov.select([35], build.extent(), False, False) # but returns "None"
build.selectedFeatureCount() # returns 0
What am I doing wrong?