0

I have a wmts layer on GeoServer and I tried to add some CQL_FILTER to my request but it's not working. Whatever I added to uri, geoserver always return result but in some cases it shouldn't.

Here's my query;

'/gwc/service/wmts?REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&CQL_FILTER=no_vol=' +
noVol + '&LAYER=workspace:liSe-layer' +
'&STYLE=&TILEMATRIX=EPSG:900913:{z}&TILEMATRIXSET=EPSG:900913&FORMAT=application/vnd.mapbox-vector-tile&TILECOL=0{x}&TILEROW={y}'

What should I do for geoserver to see my CQL_FILTER ?

Geoserver version: 2.19.2

1
  • 2
    It is documented that CQL_FILTER can be used with WMS and WFS docs.geoserver.org/latest/en/user/tutorials/cql/…. WMTS is mainly made for serving precached tiles. Have you read somewhere that you can use CQL with WMTS? It may be possible by bypassing the cache and fetching the requested tile directly from WMS but I do not know if that is supported.
    – user30184
    Commented Nov 22, 2021 at 17:28

1 Answer 1

2

A CQL_FILTER changes the contents of the tiles, which is in turn at odds with caching.

If you really want to cache with CQL_FILTER, then you should declare it as a parameter filter in the tile caching section of your layer.

Mind, doing this means a new tile cache will be created for that layer, for each new CQL_FILTER provided in the request. While defining the parameter filter, you should probably restrict which filters you actually want to cache.

Otherwise, best to switch to the WMS protocol instead.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.