The situation:
I create a project in QGIS. I use this project in a Data collection App, so that for each points I make several pictures.
The project is as follow:
- a point layer (parent layer, point - geopackage);
- a table layer (Child layer, no geometry type - geopackage -> attribute field ist set to "Attachment", type is "Image" and the path is set to "Relative to Project Path");
- a relation (Project > Properties > Relations) 1-to-many between the points and the table -> referenced field used an UUID-key;
Relation also describe here: Input App showing only two pictures
My question is:
Once my project / one-to-many relation is set up and I have created few points in the App, how do you access my photos from the child layer in an Atlas/report/Print Layout?
More Details:
I know this is possible for Attribute Tables: in your Print Layout you can check "Generate an atlas" choose your Coverage layer and if this layer has a one-to-many relations set-up you can go under "source" choose "Relation Children" and select the "relation" you want.
What I have tried with:
Add a picture object in the atlas and under "Edit" use a function to "call" the first photo of the child layer. I would then repeat this with 2 or 3 pictures objects each calling a different picture of the child layer.
I know it should be something in this direction:
@project_folder||'\\DCIM\\' = array_get(
aggregate('TableX',
'array_agg',
"Path",
'Nfoto' =
attribute(@parent,
'fid'))
,1)
The aggregate function is giving me Head Hecks and I was hoping for something similar to the attribute table solution...
"Nfoto" = ...
) instead of the Nfoto word or literal characters string ('Nfoto' = ...
). Also, the first element of the array has index 0 instead of 1. But maybe there are better ways to get the images.