1

I have a layer in which I need to apply multiple check box filters. For example, I need to filter a layer based on state, city and some other attribute based on user input/ CQL filter. Basically, I need a dynamic filtering based on multiple attributes on the layer using CQL. could any one suggest me an idea on how to do it?

  • Are you wanting this filter to be on a http WMS or WFS call or within some UI application (e.g. GeoExplorer, QGIS....etc)? – artwork21 Jul 15 '16 at 11:44
  • Hi, I need this filter to be on a WMS or WFS call and the user should be able to query the layer dynamically. – Shenbaga Rajan Jul 18 '16 at 4:53
2

Once you understand how to build the CQL query (web search on this should show you many examples), and since you have opengeo suite installed I would recommend using GeoExplorer as the client viewer to allow users to set their own filters or CQL filters.

  1. Load layer you want user to query to GeoExplorer
  2. Publish map and provide user with map url

The query may be defined by:

  1. Select layer in table of contents and right click and select Layer Properties
  2. Click on the Display tab and check the Limit with filters checkbox

Here you may define compound or CQL queries based on many layer field attributes. End users will be able to view the results in both tabular and spatial format (Query:table, Map:features).

enter image description here

1

I cannot tell you how to build the CQL client side, but the CQL itself can be easily built in the form of state = 'state name' and city = 'city name' and otherAttribute = 'the value'

Your Answer

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

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