[mapserver-users] Selecting data from multiple OGR layers

Iljya Kalai iljya.kalai at gmail.com
Wed Feb 3 09:54:33 PST 2021


Hi everyone,

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.

I discovered the UNION layer
<https://mapserver.org/mapfile/union.html#union> which seems to be the
answer. According to the documentation
<https://mapserver.org/mapfile/union.html#union> the source layer name
should be in the [Combine_SourceLayerName] attribute. However, I get this
error when I try to use it:

   msOGRLayerInitItemInfo(): OGR error. Invalid Field name:
Combine_SourceLayerName in layer `LAYER1'

 (I also tried [Union:SourceLayerName] which I found in the mapunion.c code
<https://github.com/MapServer/MapServer/blob/0f7bbf67ce7c6fec0feaa0b33033daf02e406b9b/mapunion.c#L39>,
but that gives the same error.)

Map file snippet:

LAYER
    NAME "U"
    STATUS DEFAULT
    CONNECTIONTYPE UNION
    CONNECTION "LAYER1,LAYER2"
    CLASS
       NAME "C1"
       EXPRESSION ("[Combine_SourceLayerName]" = "LAYER1")
       ...

Any ideas?

Thanks!
Iljya
P.S I'm new here!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20210203/a12e4779/attachment.htm>


More information about the MapServer-users mailing list