[Geoserver-users] GWC and CQL_Filter

I create a layer with cql_filter.

olayer = new OpenLayers.Layer.WMS( 'AR_3_13200',
'http://localhost:8080/geoserver/wms’, {CQL_Filter:'campo1=1'. 'layers:
'topp:Nodos_Sistema', transparent:'true', styles: '', srs: 'EPSG:4326',
tiled: 'true',}, { 'reprojected':true, 'isBaseLayer': false, 'opacity': 0.5
},{buffer: 0});

When I want use GWC, the CQL_filter don't work

olayer = new OpenLayers.Layer.WMS( 'AR_3_13200',
'http://localhost:8080/geoserver/gwc/service/wms’, {CQL_Filter:'campo1=1'.
'layers: 'topp:Nodos_Sistema', transparent:'true', styles: '', srs:
'EPSG:4326', tiled: 'true',}, { 'reprojected':true, 'isBaseLayer': false,
'opacity': 0.5 },{buffer: 0});

It show all layer without filter.

How can i use the CQL_Filter with GWC?

Thank You.

Abel
--
View this message in context: http://www.nabble.com/GWC-and-CQL_Filter-tp22916976p22916976.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Yeah, such a filter changes the tiles for everyone, so a client is usually not allowed to make such requests when caching is involved.

Two ways to deal with it, both of them require you to configure GeoWebCache manually, using geowebcache.xml.

1) Static CQL filter:
The old way of dealing with this is to create many layer definition, each one with its own CQL filter as a vendor parameter. The client must then request the right layer depending on what is to be shown.

2) Dynamic CQL filters:
Assuming GeoServer 1.7.3a you can do it though, by creating a regular expression parameter filter. This feature is brand new and has been tested by very few people, so there are no tutorials yet. Note that each unique filter wil result in a separate set of tiles.

See http://geowebcache.org/trac/wiki/Version1.1.0 for an explanation of the concept, and http://geowebcache.org/svn/trunk/geowebcache/src/main/resources/geowebcache.xml for a sample file.

You place the file into WEB-INF/classes ( if you are running the binary distribution, the full path is geoserver-1.7.3/webapps/geoserver/WEB-INF/classes ) and restart the servlet container.

-Arne

abelq wrote:

I create a layer with cql_filter.

olayer = new OpenLayers.Layer.WMS( 'AR_3_13200',
'http://localhost:8080/geoserver/wms’, {CQL_Filter:'campo1=1'. 'layers:
'topp:Nodos_Sistema', transparent:'true', styles: '', srs: 'EPSG:4326',
tiled: 'true',}, { 'reprojected':true, 'isBaseLayer': false, 'opacity': 0.5
},{buffer: 0});

When I want use GWC, the CQL_filter don't work

olayer = new OpenLayers.Layer.WMS( 'AR_3_13200',
'http://localhost:8080/geoserver/gwc/service/wms’, {CQL_Filter:'campo1=1'.
'layers: 'topp:Nodos_Sistema', transparent:'true', styles: '', srs:
'EPSG:4326', tiled: 'true',}, { 'reprojected':true, 'isBaseLayer': false,
'opacity': 0.5 },{buffer: 0});

It show all layer without filter.

How can i use the CQL_Filter with GWC?

Thank You.

Abel
  
--
Arne Kepp
OpenGeo - http://opengeo.org
Expert service straight from the developers