1

I'm doing a WMS request with 2 cql_filters. This is the resultant query:

?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=tmp_vista_expedientes&cql_filter=strSubstring(FecRegistro%2C0%2C4)%3D2018;strSubstring(codigo,0,3)=%27201%27&time=1573127644387&WIDTH=256&HEIGHT=256&CRS=EPSG%3A25830&STYLES=&BBOX=0 ... 0

Basically I have 2 filters:

strSubstring(FecRegistro,0,4)=2018

And

strSubstring(codigo,0,3)='201'

Separating them with a semicolon ;. But only the first filter is applied.

How can I make both filters be applied?

1

If you are trying to filter two distinct layers then you need to separate the filters with ; but if you are trying to combine two (or more) filters on a single layer then you need to use and or or as joining commands.

So in your case I would apply:

strSubstring(FecRegistro,0,4)=2018 or strSwhubstring(codigo,0,3)='201'

which will return all filters which match either of the filters. or

strSubstring(FecRegistro,0,4)=2018 and strSubstring(codigo,0,3)='201'

which will return any feature that matches both of the filters.

| improve this answer | |
  • Dude! You are everywhere haha! As always you were right, thanks for real for your labour – Iñigo Nov 7 '19 at 14:46

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.