3

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'

enter image description here

Does someone understand why it isn't working?

Taras
35.8k5 gold badges77 silver badges152 bronze badges
asked Mar 22, 2022 at 13:05
6
  • Did you check with the plugin provider? Commented 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? Commented 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. Commented Mar 22, 2022 at 13:16
  • Can you try to reinstall the plugin? Commented Mar 22, 2022 at 13:46
  • 2
    What do you mean by overview? Commented Mar 22, 2022 at 17:25

2 Answers 2

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:

enter image description here

answered Mar 22, 2022 at 15:13
0

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.

enter image description here

answered Apr 1, 2022 at 8:12

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.