I have a point layer named closure
and a line layer named cable
in QGIS.
Within closure
there's 4 fields (id
, type
, ingress
, egress
),
cable has 4 fields (id
, type
, from
, to
).
I have managed to form a code within attribute form to tell me that cable starts at closure
Point A (from
will show me closure
type
):
aggregate(layer:='closures_v1', aggregate:='max', expression:="type",
filter:= intersects( $geometry, start_point(geometry(@parent))))
and ends at closure Point B (to will show me closure
type
):
aggregate(layer:='closures_v1', aggregate:='max', expression:="type",
filter:= intersects( $geometry, end_point(geometry(@parent))))
Though I have not been able to autogenerate the fields for the closure
layers' columns ingress
and egress
. ingress
will represent the cable
that is entering the closure
(there can only be one), egress
will represent the cable
that is exiting the closure
(there can be multiple). The autogenerated field will tell me the cable
type
.
Is this possible?
Let’s says I had one closure
point called 'main closure', I will draw a cable
(whatever I decide to label it, in this called 'cable IN') to end at the 'main closure' --- this will be my ingress
cable.
Then, I draw two cable
s starting from the 'main closure'(I will label these 'cable out1' and 'cable out2').
I would like an automated process to auto-fill my ingress
layer to tell me that 'cable IN' is the cable
entering the 'main closure', and my egress
layer to tell me that 'cable out1' and 'cable out2' are exiting 'main closure'.
closure
, but in your expression, it is namedclosures_v1
- this adds to the confusion, as well that you don't tell us which of the attribute fields contains the name (likecable in
). So we have to make a lot of assumptions. When asking a question, you should always be as clear as possible.