Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vendor WMS parameter FILTER not work with attribute parameters in STYLE #6200

Closed
guardeivid opened this issue Dec 16, 2020 · 5 comments
Closed

Comments

@guardeivid
Copy link

Hi, using [attribute] for example in COLOR or OUTLINECOLOR, and then a FILTER vendor parameter is applied from a client, it does not return any geometry

LAYER
  ...
  STYLE
    ...
    COLOR [color]

On the contrary, if the FILTER is applied and the layer has a color defined in hexadecimal or rgb if it works

@jratike80
Copy link

I wonder if rendering through the QUERYMAP mechanism https://mapserver.gis.umn.edu/development/rfc/ms-rfc-118.html is dropping the attribute.

@sdlime
Copy link
Member

sdlime commented Dec 17, 2020

@jratike80 may be right although a QUERYMAP, depending on its STYLE definition, could ignore the attribute since in some cases another color is always used regardless. It should draw something however. Do you have a sample mapfile? What version are we talking? --Steve

@guardeivid
Copy link
Author

guardeivid commented Dec 29, 2020

MapServer version 7.4.2

This is the mapfile that I have defined

MAP
  NAME "map_name"
  IMAGETYPE   PNG
  EXTENT      -7373092.64639 -5104200.06070 -6142762.23928 -3812720.03098
  SIZE        2440 2440
  UNITS meters
  IMAGECOLOR  255 255 255
  SHAPEPATH   "../data"
  SYMBOLSET   "../symbols.sym"
  FONTSET     "../font.list"

 OUTPUTFORMAT
  NAME "png"
  DRIVER AGG/PNG
  MIMETYPE "image/png"
  IMAGEMODE RGBA
  EXTENSION "png"
  FORMATOPTION "GAMMA=0.75"
END
OUTPUTFORMAT
  NAME "gif"
  DRIVER GD/GIF
  MIMETYPE "image/gif"
  IMAGEMODE RGBA #PC256
  EXTENSION "gif"
  FORMATOPTION "TRANSPARENT=ON"
  FORMATOPTION "INTERLACE=OFF"
  TRANSPARENT ON
END
OUTPUTFORMAT
  NAME "png8"
  DRIVER AGG/PNG8
  MIMETYPE "image/png; mode=8bit"
  IMAGEMODE RGBA
  EXTENSION "png"
  FORMATOPTION "QUANTIZE_FORCE=on"
  FORMATOPTION "QUANTIZE_COLORS=256"
  FORMATOPTION "GAMMA=0.75"
END

  WEB
     IMAGEPATH "/tmp/"
     IMAGEURL "/tmp/"
     METADATA
       "wms_enable_request"         "*"
       "wms_title"                  "WMS MDQ"
       INCLUDE                      "WMS_ONLINERESOURCE.txt"
       "wms_srs"                    "EPSG:3857 EPSG:4326 EPSG:900913"
       "ows_srs"                    "EPSG:3857 EPSG:4326 EPSG:900913"
       "wms_formatlist"             "image/png, image/gif,image/jpg"
       "wms_format"                 "image/png"
       "oms_abstract"               "abstract"
       "wms_transparent"            "true"
       "gml_include_items"          "all"
       "wms_feature_info_mime_type" "text/html"
       "gml_feature_info_mime_type" "text/html"
     END # METADATA
  END # WEB

  PROJECTION
       "init=epsg:3857"
  END

... 
LAYER
    NAME 'layer_name'
    TYPE POLYGON
    CONNECTIONTYPE postgis
    CONNECTION ...
    DATA ...
    PROCESSING "CLOSE_CONNECTION=DEFER"

    METADATA
      'ows_title'          'layer_name'
      "wms_srs"            "EPSG:4326"
      "wms_title"          "layer_name"
      "wms_format"         "image/png"
      "wms_server_version" "1.1.1"
      "wms_include_items"  "all"
    END # METADATA

    PROJECTION
       "init=epsg:4326"
    END # PROJECTION

    STATUS OFF
    TEMPLATE void

    CLASS
      NAME "class name"
      STYLE
        OUTLINECOLOR [color]
        WIDTH 2.5
      END # STYLE
    END # CLASS
END # LAYER

END # MAP

@maltaesousa
Copy link

Hi, I'm also experimenting this issue on versions 7.6 and 7.7-dev

Here's my mapfile and the data.shp referenced by it can be downloaded here

MAP
    NAME "test"
    STATUS ON
    SIZE 600 400
    EXTENT 2500000 1160000 2600000 1250000
    UNITS METERS
    SHAPEPATH "./data"
    IMAGECOLOR 255 255 255
    PROJECTION
        "init=epsg:2056"
    END
    WEB
        TEMPPATH "/tmp"
        METADATA
            "wms_title" "WMS server"
            "ows_onlineresource" "http://localhost:5010?"
            "wms_enable_request" "*"
            "wms_allow_getmap_without_styles" "true"
        END
    END

    LAYER
        NAME 'colors'
        TYPE POLYGON
        STATUS ON
        PROJECTION
            "init=epsg:2056"
        END
        DATA "data.shp"
        EXTENT 2500000 1160000 2600000 1250000
        CLASS
            NAME "name1"
            STYLE
                COLOR [color]
                OUTLINECOLOR 0 0 0
            END
        END
    END # LAYER
END # MAP

Without filter:

http://localhost:5010/?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image/png&TRANSPARENT=true&LAYERS=colors&CRS=EPSG:2056&WIDTH=2343&HEIGHT=1044&BBOX=2432850,1152800,2667150,1257200

without

With filter:
http://localhost:5010/?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image/png&TRANSPARENT=true&LAYERS=colors&CRS=EPSG:2056&WIDTH=858&HEIGHT=383&BBOX=2508300,1192150,2594100,1230450&FILTER=(%3CFilter%20xmlns=%22http://www.opengis.net/ogc%22%3E%3CPropertyIsEqualTo%3E%3CPropertyName%3Ename%3C/PropertyName%3E%3CLiteral%3Etest1%3C/Literal%3E%3C/PropertyIsEqualTo%3E%3C/Filter%3E)

with

jmckenna added a commit that referenced this issue Jun 23, 2021
WMS: make attribute color binding work with FILTER vendor parameter (fixes #6200)
@jmckenna
Copy link
Member

Thanks to @guardeivid for the report, @maltaesousa for the testing, and @rouault for the fix!

@jmckenna jmckenna added this to the 7.6.4 Release milestone Jun 23, 2021
rouault added a commit that referenced this issue Jun 24, 2021
[Backport branch-7-6] WMS: make attribute color binding work with FILTER vendor parameter (fixes #6200)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants