Andrea,

I tried the demo and it works perfectly. Now I'm getting a problem with the 
request because we have a proxy between openscales and geoserver and somehow 
the url is being changed (or something else) and geoserver is ignoring the 
cql_filter parameter. Anyway... this problem is not related to the geo stuff.

Thank you very much for your excellent answer.

On May 14, 2010, at 12:04 PM, Andrea Aime wrote:

> Miranda Mauricio ha scritto:
>> Hi people!
>> Quick question... is it possible to filter a getfeatureinfo request with a 
>> cql_filter parameter or something like that?
> 
> In GeoServer it is possible, but we're talking about a custom extension
> here, cql_filters are not part of the standard WMS protocol.
> 
> For example, here is a WMS query that will return all US states starting with 
> an M (filter is STATE_NAME LIKE 'M%')
> 
> http://demo.opengeo.org/geoserver/wms?HEIGHT=330&WIDTH=780&LAYERS=topp%3Astates&STYLES=&SRS=EPSG%3A4326&FORMAT=image%2Fpng&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&CQL_FILTER=STATE_NAME%20LIKE%20%27M%25%27&BBOX=-139.84813671875,18.549615234375,-51.85286328125,55.778384765625
> 
> And then we can do a GetFeatureInfo over Kansas, and if
> you don't add the filter, you get back the usual HTML table:
> 
> http://demo.opengeo.org/geoserver/wms?REQUEST=GetFeatureInfo&EXCEPTIONS=application%2Fvnd.ogc.se_xml&BBOX=-139.848137%2C18.549615%2C-51.852863%2C55.778385&X=363&Y=148&INFO_FORMAT=text%2Fhtml&QUERY_LAYERS=topp%3Astates&FEATURE_COUNT=50&Layers=topp%3Astates&Styles=&Srs=EPSG%3A4326&WIDTH=780&HEIGHT=330&format=image%2Fpng
> 
> but if you add the filter, you get back nothing as Kansas does not satisfy it:
> 
> http://demo.opengeo.org/geoserver/wms?REQUEST=GetFeatureInfo&EXCEPTIONS=application%2Fvnd.ogc.se_xml&BBOX=-139.848137%2C18.549615%2C-51.852863%2C55.778385&X=363&Y=148&INFO_FORMAT=text%2Fhtml&QUERY_LAYERS=topp%3Astates&FEATURE_COUNT=50&Layers=topp%3Astates&Styles=&Srs=EPSG%3A4326&WIDTH=780&HEIGHT=330&format=image%2Fpng&CQL_FILTER=STATE_NAME%20LIKE%20%27M%25%27
> 
> As I said, all of this is GeoServer specific. Other server might have
> different ways of providing a similar functionality
> 
> Cheers
> Andrea
> 
> -- 
> Andrea Aime
> OpenGeo - http://opengeo.org
> Expert service straight from the developers.
> _______________________________________________
> Discuss mailing list
> Discuss@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/discuss

Mauricio Miranda
Software Engineering Manager
http://www.xoomcode.com



_______________________________________________
Discuss mailing list
Discuss@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/discuss

Reply via email to