This code uses QgsVectorLayer.changeAttributeValue() method to update the field checked’s value to Y. Under the Action Text enter the following Python code and click OK. Leave the Action Scopes to the default selected values of Feature and Canvas. Switch to the Actions tab and click the Add a new action ( +) button.Right-click the parcels layer and select Properties.Let’s setup an action to automate this QA process. Let’s say we are tasked with checking each feature and then updating the value of this field to Y once it has been checked. This column contains the value of either Y or N. This project contains the same parcels layer that has been styled and labeled using the values from the checked column.Open the Parcels_QA.qgz project from your data package.Click OK again to get back to the main QGIS Canvas. Enter Select all Parcels from the Block as the Description. Right-click the parcels layer and select Properties. Let’s build an action that allows us to select all parcels from a block with a single click. A common task while managing such data is to select all parcels belonging to the same block.If we select a few parcels belonging to the same city block, you will see that they all have the same value for the block_num attribute. A city block is a group of parcels that is surrounded by streets.The mapblklot attribute contains a unique identifier for each parcels and the block_num attribute has a unique identifier for each city block. Select the parcels layer and open the Attribute Table.Open the Parcels_Multi_Select.qgz project from your data package.Update the code to print the attribute value as below.This is a special expression syntax which indicates that the value surrounded by will be replaced with the value of the attribute from the feature when the action is triggered. You will see the value entered in the Action Text text box.Select the NAME attribute and click Insert.
0 Comments
Leave a Reply. |