[mapserver-users] Selecting data from multiple OGR layers

Tamas Szekeres szekerest at gmail.com
Wed Feb 3 10:16:04 PST 2021


Iljya,

You might probably try Union_SourceLayerName as the attribute name.

Best regards,

Tamas




Iljya Kalai <iljya.kalai at gmail.com> ezt írta (időpont: 2021. febr. 3., Sze,
18:54):

> 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!
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20210203/22f2a5be/attachment.html>


More information about the mapserver-users mailing list