<div dir="ltr">Hi everyone,<div><br></div><div>I'm trying to select data from multiple OGR layers and style them based on the source layer, as well as some attributes that are not common to all layers.</div><div><br></div><div>I discovered the <a href="https://mapserver.org/mapfile/union.html#union" target="_blank">UNION layer</a> which seems to be the answer. According to the <a href="https://mapserver.org/mapfile/union.html#union" target="_blank">documentation</a> the source layer name should be in the <font face="monospace">[Combine_SourceLayerName]</font> attribute. However, I get this error when I try to use it:<div><br></div><div><font face="monospace">   msOGRLayerInitItemInfo(): OGR error. Invalid Field name: Combine_SourceLayerName in layer `LAYER1'</font><br></div><div><br></div> (I also tried [Union:SourceLayerName] which I found in the <a href="https://github.com/MapServer/MapServer/blob/0f7bbf67ce7c6fec0feaa0b33033daf02e406b9b/mapunion.c#L39" target="_blank">mapunion.c code</a>, but that gives the same error.)</div><div><br></div><div>Map file snippet:</div><div><br></div><div><div>LAYER<br>    NAME "U"<br>    STATUS DEFAULT<br>    CONNECTIONTYPE UNION<br>    CONNECTION "LAYER1,LAYER2"<br>    CLASS<br>       NAME "C1"<br>       EXPRESSION ("[Combine_SourceLayerName]" = "LAYER1")</div><div>       ...</div><div><br></div><div>Any ideas?</div></div><div><br></div><div>Thanks!</div><div>Iljya</div>P.S I'm new here!<br></div>