1

I have wms layers like:

LAYERS=layer1,layer2&CQL_FILTER=(type=10);INCLUDE

it works fine but when I add another filter with 'and' operator to layer 1 it does not show on map. I am adding second filter like:

LAYERS=layer1,layer2&CQL_FILTER=(type=10 and range='20_100');INCLUDE

result returns text/html instead of png.

Here is my loadWMS function:

loadWMS: function (index, layerNames, cqlFilters, opacity, styles) {
        var customParams = [
            "FORMAT=image/png",
            "LAYERS=" + layerNames,
            "CQL_FILTER=" + (cqlFilters ? cqlFilters : "include"),
            "SRS=EPSG:900913",
            "EXCEPTIONS=application%2Fvnd.ogc.se_inimage",
            "STYLES=" + (styles && styles.length ? styles : "")
        ];

My params:

["FORMAT=image/png", "LAYERS=ADR_geo:yatirim_fiyat_adet_ek_all_10_view_all,ADR_geo:lake_sea_river_turkey", "CQL_FILTER=(type=10 AND range ='20_100');include", "SRS=EPSG:900913", "EXCEPTIONS=application%2Fvnd.ogc.se_inimage", "STYLES=ADR_geo:yatirim_grid_10_kirmizi,ADR_geo:yatirim_grid_10_kirmizi"]

What is wrong with cql_filter?

Edit for @iant : The html is 0 KB. so it comes empty screen. In Geoserver's map preview, the cql filter works like type=10 and range'20_100'

2
  • 1
    Welcome to GIS SE! As a new user be sure to take the Tour to learn about our focussed Q&A format. You appear to have created two accounts which inevitably leads to a frustrating experience for you, potential answerers and reviewers so please follow these instructions ASAP to merge your accounts. – PolyGeo May 10 '17 at 8:44
  • 1
    the html will include the error message that tells you what went wrong, open it and add it to your question. The most likely issue is that you don't have an attribute called range or that GeoServer is confused by the format of your string and thinks it is a number. – Ian Turton May 10 '17 at 10:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.