WebAshlar WebAshlar - 16 days ago 5
C# Question

geoserver - WFS Error : bbox and cql_filter both specified but are mutually exclusive

I am trying to get the following WFS GET request to work:

http://domain.com:8080/geoserver/bla/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=testing&outputFormat=json
&bbox=-120.67383749999999,26.667051210679244,-70.75196249999999,46.25581231694961

But ,I will add cql_filter with bbox then getting below error
Error:bbox and cql_filter both specified but are mutually exclusive

http://domain.com:8080/geoserver/bla/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=testing&outputFormat=json
&bbox=-120.67383749999999,26.667051210679244,-70.75196249999999,46.25581231694961&cql_filter=RENEWABLE='Biomass'

Answer

That is correct, the WFS specification says that the various shorthand filter KVPs are mutually exclusive, cannot be used in conjuction.

The good news is that you can encode the whole filter can be expressed as a single CQL_FILTER expression, see some docs here: http://docs.geoserver.org/latest/en/user/tutorials/cql/cql_tutorial.html#geometric-filters

As an alternative, you can also do the same using the FILTER parameter and using the XML OGC Filter encoding.

Comments