I'm looking for a way to select multiple attributes from about 9-13 vector layers. I downloaded the "Multiple layer selection" plugin, but I get an error.
2022年03月22日T14:01:20 WARNING Traceback (most recent call last):
File "C:\Users/Gebruiker/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\MultipleLayerSelection\MultiLayerRectangleSelection.py", line 43, in canvasReleaseEvent
layer.selectByRect(lRect, False)
TypeError: QgsVectorLayer.selectByRect(): argument 2 has unexpected type 'bool'
Does someone understand why it isn't working?
-
Did you check with the plugin provider?Erik– Erik2022年03月22日 13:06:25 +00:00Commented Mar 22, 2022 at 13:06
-
Which QGIS version is it? Do you need to select by location or by attribute within all those 9-13 vector layers?Taras– Taras ♦2022年03月22日 13:11:08 +00:00Commented Mar 22, 2022 at 13:11
-
I have qgis 3.22.4. I want to get an overview of the attributes that are within the square that I draw.Yelper– Yelper2022年03月22日 13:16:06 +00:00Commented Mar 22, 2022 at 13:16
-
Can you try to reinstall the plugin?Taras– Taras ♦2022年03月22日 13:46:16 +00:00Commented Mar 22, 2022 at 13:46
-
2What do you mean by overview?Bera– Bera2022年03月22日 17:25:10 +00:00Commented Mar 22, 2022 at 17:25
2 Answers 2
Create a new polygon layer. Draw a polygon that covers the area from where you want to get the attributes. Use the following expression without any adaption to get all attributes from all features of all layers within this polygon:
array_to_string (
array_foreach (
@layers,
with_variable (
'currentlayer',
layer_property(@element, 'name'),
array_to_string(
array_foreach (
generate_series(
0,
array_length(
overlay_intersects(
@currentlayer,
$id
)
)-1
),
map_to_hstore(
attributes(
get_feature_by_id(
@currentlayer,
overlay_intersects(
@currentlayer,
$id
)[@element]
)
)
)
)
)
)
)
)
Screenshot: the label in the red box is created based on the expression above. It contains all key:value pairs (attribute name/attribute value) of all features that intersect the polygon outlined in red, taking into consideration all layers:
In the end the Multilayer Select tool worked after a reboot and placing my final files in a new Qgis project.
However, to get the result I wanted I simply had to use the Identify Features Tool. I did not realise you could do more than click on a seperate feature, but instead make a selection by drawing a box. This gives me the "overview" that I wanted.
Explore related questions
See similar questions with these tags.