0

I am using Geoserver to generate colored regions on a map a wms link, CQL condition can contain a long string of "IN". Max number of INs could be up to 1-2 thousands. I tried to divide it into 3 requests, but such filters are loading the processors very much. Is there any way to get the result and not use long CQL filters? CQL filter example

6
  • I thought about it, hope it will help. Seems the problem is with very long URL processing with GET. I will give it a try. BR, Andrey Jul 24, 2020 at 7:27
  • slightly off topic: maybe you don't need to build and send thousands of Ids, but rather a higher level filter (like field1 is not null and field2 > field3). Or if that's not possible, the ID list could be saved in a table on the server side and you join the ID list to the layer. In the screenshot you have provided, on the map side, the filters seems pretty generic so sending a huge list of IDs seems overkilled
    – JGH
    Jul 24, 2020 at 11:50
  • Hi JGH, thanks for your remark. Jul 25, 2020 at 20:21
  • Hi JGH, thanks for your remark. The matter is that the list of IDs (RDAs) is generated depending on the radio amateur callsign in the browser form, and the list of IDs is a result of XHR to another site. And it can not be described with logic like (like field1 is not null and field2 > field3), it is just a list of results. So, the table is dynamic, could you please point me how to save it on server side (you mean in geoserver, right)? Any help is appreciated... Jul 25, 2020 at 20:27
  • Not necessarily in GeoServer. It could be your webapp fetching and storing (maybe in a database) the data from the external API, then GeoServer can return a joined view between the raw data and this user specific list. Of course it means you need to work per user on the server side, clean up obsolete data etc
    – JGH
    Jul 27, 2020 at 12:04

1 Answer 1

2

The list of IDs still need to be communicated, and the WMS protocol is entirely stateless, so it needs to be communicated at every request. What you can do, is to switch to POST requests instead of GET, putting all the query parameters into a application/x-www-form-urlencoded payload (same as if you were posting a HTML form).

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.