Skip to content

Commit

Permalink
WMS: make attribute color binding work with FILTER vendor parameter (f…
Browse files Browse the repository at this point in the history
…ixes #6200)
  • Loading branch information
rouault authored and github-actions[bot] committed Jun 23, 2021
1 parent 91a9d4c commit 1a98ac7
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mapdraw.c
Expand Up @@ -1307,7 +1307,7 @@ int msDrawQueryLayer(mapObj *map, layerObj *layer, imageObj *image)
{
int i, status;
char annotate=MS_TRUE, cache=MS_FALSE;
int drawmode = MS_DRAWMODE_FEATURES|MS_DRAWMODE_QUERY;
int drawmode = MS_DRAWMODE_FEATURES;
shapeObj shape;
int maxnumstyles=1;

Expand Down Expand Up @@ -1356,6 +1356,9 @@ int msDrawQueryLayer(mapObj *map, layerObj *layer, imageObj *image)

/* if MS_HILITE, alter the one style (always at least 1 style), and set a MINDISTANCE for the labelObj to avoid duplicates */
if(map->querymap.style == MS_HILITE) {

drawmode |= MS_DRAWMODE_QUERY;

if (layer->numclasses > 0) {
colorbuffer = (colorObj*)msSmallMalloc(layer->numclasses*sizeof(colorObj));
mindistancebuffer = (int*)msSmallMalloc(layer->numclasses*sizeof(int));
Expand Down
Binary file added msautotest/wxs/expected/wms_filter_color_bind.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
106 changes: 106 additions & 0 deletions msautotest/wxs/wms_filter_color_bind.map
@@ -0,0 +1,106 @@
#
# Test WMS vendor-specific FILTER with attribute color binding
#
# REQUIRES: INPUT=GDAL OUTPUT=PNG SUPPORTS=WMS
#
#
# RUN_PARMS: wms_filter_color_bind.png [MAPSERV] QUERY_STRING="map=[MAPFILE]&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image/png&TRANSPARENT=true&LAYERS=test001&WIDTH=500&HEIGHT=500&CRS=EPSG:4326&BBOX=0,-1.5,1,0&STYLES=&FILTER=(%3CFilter%20xmlns=%22http://www.opengis.net/ogc%22%3E%3CPropertyIsEqualTo%3E%3CPropertyName%3Esymbol%3C/PropertyName%3E%3CLiteral%3Ecircle%3C/Literal%3E%3C/PropertyIsEqualTo%3E%3C/Filter%3E)" > [RESULT_DEMIME]

MAP
NAME WMS_FILTER_COLOR_BIND
STATUS ON
SIZE 500 500
EXTENT -1.5 0 -0.5 1
UNITS DD
IMAGECOLOR 255 255 255
SHAPEPATH ../misc/data
SYMBOLSET etc/symbols.sym
FONTSET ../misc/fonts.lst

WEB

IMAGEPATH "/tmp/ms_tmp/"
IMAGEURL "/ms_tmp/"

METADATA
"wms_title" "Test simple wms"
"wms_onlineresource" "http://localhost/path/to/wms_simple?"
"wms_srs" "EPSG:4326"
"ows_schemas_location" "http://ogc.dmsolutions.ca"
"ows_enable_request" "*"
END
END

PROJECTION
"init=epsg:4326"
END

IMAGETYPE PNG

SYMBOL
NAME 'triangle'
TYPE VECTOR
POINTS
0 4
2 0
4 4
0 4
END
FILLED TRUE
END

SYMBOL
NAME 'square'
TYPE VECTOR
POINTS 0 0 1 0 1 1 0 1 0 0 END
FILLED TRUE
END

SYMBOL
NAME 'circle'
TYPE ELLIPSE
POINTS 1 1 END
FILLED TRUE
END

LAYER
METADATA
"wms_title" "test001"
"wms_description" "test001"
END
PROJECTION
"init=epsg:4326"
END

NAME 'test001'
TYPE POINT
DATA 'attrbind'
STATUS OFF
LABELITEM 'text'
CLASS
STYLE # a shadow
COLOR 151 151 151
SYMBOL [symbol]
OFFSET 2 2
SIZE [size]
END
STYLE
COLOR [color]
SYMBOL [symbol]
SIZE [size]
END
LABEL
STYLE
GEOMTRANSFORM "labelpoly"
COLOR [color]
END
TYPE TRUETYPE
FONT 'default'
COLOR [lcolor]
SIZE [lsize]
POSITION UR
END
END
END
END

0 comments on commit 1a98ac7

Please sign in to comment.