25 Nov 2020

QGIS3: Aggregate Data of Intersecting Features: Concatenate String Attributes of Polygons Crossed by Line Features

regexp_replace(aggregate(layer:='Prcl_Lyr', aggregate:='concatenate', expression:="Prp_Ownr",filter:=intersects( $geometry, geometry(@parent)), concatenator:='/'), '[/]{2,}', '/')
Polygon Layer "Parcell_Lyr" Field holding Owner Data "Prop_Ownr" The parent layer is the line layer with the lines, for which we want to collect the polygon data, intersected by the single line features. For aggregated NULL or empty strings the concatenator character would be replicated without strings inbetween - for this, the regex "[/]{2,}" which matches a forward slash, repeated twice or more, will replace those doubled slashes with a single one.

No comments :

Post a Comment