TransWikia.com

QGIS Atlas attributes

Geographic Information Systems Asked by asham on May 23, 2021

So I have two layers. First one is line layer (columns: id, length, address_id) and atlas is connected to it so when I change objects, map is zooming to next line. Secound is point layer (columns: address_id, city, street, house_number). Both of these layers are related by address_id value and also line layer is intersecting wtih point layer.

I want to display below map, tables in which there will be placed attribbutes from point layer(city, street and house_number) and every time I change atlas object new attributed will be shown in these tables. I was trying to make expressing using attribute function but no success.

Is there any easy way to make it happen. I could insert all information from point to line but i would like to avoid this solution.

2 Answers

Assuming that you have a one-to-one intersecting relationship between the two layers (i.e. 1 line only intersects 1 point), then you could look at using the aggregate function.

Check the answer by eurojam to this question on stack as it seems a similar type of scenario.

You essentially can create an aggregate function stating: Where my atlas feature (line), intersects a point, provide me the attribute I want from the point layer.

As pointed out in the comments there, you can also define a buffer around the point within the aggregate function in case the intersect itself doesn't work (just go for a tiny buffer).

This would basically be doing a spatial comparison, rather than a tabular comparison to achieve the same result.

Note, you can add an attribute table in the composer that will contain this information, along with your line attributes in a neat and tidy fashion.

Answered by JClarkson on May 23, 2021

You can obtain your request task using a filter in the Layout->Item Properties of you Attribute Table.

Using the expression address_id= @atlas_featureid

you should see your table be populated only by the points having a common address_id with your line used as atlas coverage.

enter image description here

Answered by Val P on May 23, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP