Created
June 28, 2021 15:35
-
-
Save jecogeo/be3002cd603d2a5472a20f4be28b528d to your computer and use it in GitHub Desktop.
selecionar features cuja soma da tabela de atributos ordenada é >=x
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pega o layer | |
layer = qgis.utils.iface.activeLayer() | |
# acessa a tabela de atributos | |
features = layer.getFeatures() | |
# ordena a tabela ded atributos | |
# aqui um teste | |
for feat in features: | |
print(sorted(feat["producao"])) | |
# valor que será o limiar de seleção | |
x = 2000 | |
# seleciona todas as features cuja soma ordenada pelo campo producao" é <=2000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Segue