Hi,

You are right. With all the quotes doubled it works fine.
Thank you for a prompt response!

Best Regards
Martyna

From: Andrea Aime <[email protected]>
Sent: Wednesday, March 4, 2020 2:24 PM
To: Kolaczek, Martyna Julia <[email protected]>
Cc: [email protected]
Subject: Re: [Geoserver-users] Geoserver - problem with CQL filter, when value 
contains single quote and there are no results

Hi,
if I URL-decode the first filter, it looks like this:

(1 = 1) AND (1 = 1 AND (region = 'JAPAC') AND (country = 'South Korea') AND 
(state = 'Chungcheongnamdo [Ch''ungch'ongnam-do]'))

Only one of the single quotes has been doubled. If also the second is repeated, 
as expected, then there is no error:

https://abbvie-ows.omnilocation-iot.com/geoserver/abbvie/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=asset_site&TILED=true&CQL_FILTER=(1%20%3D%201)%20AND%20(1%20%3D%201%20AND%20(region%20%3D%20%27JAPAC%27)%20AND%20(country%20%3D%20%27South%20Korea%27)%20AND%20(state%20%3D%20%27Chungcheongnamdo%20%5BCh%27%27ungch%27%27ongnam-do%5D%27))&TIME_=1583319334693&viewparams=&WIDTH=512&HEIGHT=512&CRS=EPSG%3A3857&STYLES=&BBOX=10018754.17139462%2C5009377.085697312%2C15028131.257091932%2C10018754.171394624<https://clicktime.symantec.com/3EGgX876wMon1YPnKUXATea7Vc?u=https%3A%2F%2Fabbvie-ows.omnilocation-iot.com%2Fgeoserver%2Fabbvie%2Fwms%3FSERVICE%3DWMS%26VERSION%3D1.3.0%26REQUEST%3DGetMap%26FORMAT%3Dimage%252Fpng%26TRANSPARENT%3Dtrue%26LAYERS%3Dasset_site%26TILED%3Dtrue%26CQL_FILTER%3D%281%2520%253D%25201%29%2520AND%2520%281%2520%253D%25201%2520AND%2520%28region%2520%253D%2520%2527JAPAC%2527%29%2520AND%2520%28country%2520%253D%2520%2527South%2520Korea%2527%29%2520AND%2520%28state%2520%253D%2520%2527Chungcheongnamdo%2520%255BCh%2527%2527ungch%2527%2527ongnam-do%255D%2527%29%29%26TIME_%3D1583319334693%26viewparams%3D%26WIDTH%3D512%26HEIGHT%3D512%26CRS%3DEPSG%253A3857%26STYLES%3D%26BBOX%3D10018754.17139462%252C5009377.085697312%252C15028131.257091932%252C10018754.171394624>

Hope this helps

Cheers
Andrea


On Wed, Mar 4, 2020 at 12:46 PM Kolaczek, Martyna Julia 
<[email protected]<mailto:[email protected]>> wrote:
Hello,

I have a problem with filtering a layer, when filter value contains a single 
quote (which I replace with two single quotes – according to a specification: 
https://docs.geoserver.org/stable/en/user/filter/ecql_reference.html#ecql-literal<https://clicktime.symantec.com/3VAV8Yifba3yDYhkxebs6Xe7Vc?u=https%3A%2F%2Fdocs.geoserver.org%2Fstable%2Fen%2Fuser%2Ffilter%2Fecql_reference.html%23ecql-literal>).
Values are filtered correctly when there are some results. If the result should 
be empty layer – I get following exception in the response:

<?xml version="1.0" encoding="UTF-8"?><ServiceExceptionReport version="1.3.0" 
xmlns="http://www.opengis.net/ogc<https://clicktime.symantec.com/37bC9hRTj74B8wYA4sgnuqp7Vc?u=http%3A%2F%2Fwww.opengis.net%2Fogc>"
 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance<https://clicktime.symantec.com/37AN4CYJXoUjyX7HuG2K92e7Vc?u=http%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema-instance>"
 
xsi:schemaLocation="http://www.opengis.net/ogc<https://clicktime.symantec.com/37bC9hRTj74B8wYA4sgnuqp7Vc?u=http%3A%2F%2Fwww.opengis.net%2Fogc>
 
https://abbvie-ows.omnilocation-iot.com/geoserver/schemas/wms/1.3.0/exceptions_1_3_0.xsd<https://clicktime.symantec.com/37NoqhTRTnLSU6i3XvKa8947Vc?u=https%3A%2F%2Fabbvie-ows.omnilocation-iot.com%2Fgeoserver%2Fschemas%2Fwms%2F1.3.0%2Fexceptions_1_3_0.xsd>">
   <ServiceException>
      Could not parse CQL filter list.
Encountered &quot;ongnam&quot; at line 1, column 115.
Was expecting one of:
    &quot;and&quot; ...
    &quot;or&quot; ...
    &quot;)&quot; ...
    &quot;/&quot; ...
    &quot;*&quot; ...
    &quot;+&quot; ...
    &quot;-&quot; ...
     Parsing : (1 = 1) AND (1 = 1 AND (region = &apos;JAPAC&apos;) AND (country 
= &apos;South Korea&apos;) AND (state = &apos;Chungcheongnamdo 
[Ch&apos;&apos;ungch&apos;ongnam-do]&apos;)).
</ServiceException></ServiceExceptionReport>

And here is a request that I send:

https://abbvie-ows.omnilocation-iot.com/geoserver/abbvie/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=asset_site&TILED=true&CQL_FILTER=(1%20%3D%201)%20AND%20(1%20%3D%201%20AND%20(region%20%3D%20%27JAPAC%27)%20AND%20(country%20%3D%20%27South%20Korea%27)%20AND%20(<https://clicktime.symantec.com/3M6FHMLe8ZqTvyeNpREpafu7Vc?u=https%3A%2F%2Fabbvie-ows.omnilocation-iot.com%2Fgeoserver%2Fabbvie%2Fwms%3FSERVICE%3DWMS%26VERSION%3D1.3.0%26REQUEST%3DGetMap%26FORMAT%3Dimage%252Fpng%26TRANSPARENT%3Dtrue%26LAYERS%3Dasset_site%26TILED%3Dtrue%26CQL_FILTER%3D%281%2520%253D%25201%29%2520AND%2520%281%2520%253D%25201%2520AND%2520%28region%2520%253D%2520%2527JAPAC%2527%29%2520AND%2520%28country%2520%253D%2520%2527South%2520Korea%2527%29%2520AND%2520%28>state%20%3D%20%27Chungcheongnamdo%20%5BCh%27%27ungch%27ongnam-do%5D%27))&TIME_=1583319334693&viewparams=&WIDTH=512&HEIGHT=512&CRS=EPSG%3A3857&STYLES=&BBOX=10018754.17139462%2C5009377.085697312%2C15028131.257091932%2C10018754.171394624

If there is at least one result (on the whole layer), I get a correct image as 
a response. Here is a sample request that works fine:

https://abbvie-ows.omnilocation-iot.com/geoserver/abbvie/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=asset_site&TILED=true&CQL_FILTER=(1%20%3D%201)%20AND%20(1%20%3D%201%20AND%20(region%20%3D%20%27JAPAC%27)%20AND%20(country%20%3D%20%27South%20Korea%27)%20AND%20(<https://clicktime.symantec.com/3M6FHMLe8ZqTvyeNpREpafu7Vc?u=https%3A%2F%2Fabbvie-ows.omnilocation-iot.com%2Fgeoserver%2Fabbvie%2Fwms%3FSERVICE%3DWMS%26VERSION%3D1.3.0%26REQUEST%3DGetMap%26FORMAT%3Dimage%252Fpng%26TRANSPARENT%3Dtrue%26LAYERS%3Dasset_site%26TILED%3Dtrue%26CQL_FILTER%3D%281%2520%253D%25201%29%2520AND%2520%281%2520%253D%25201%2520AND%2520%28region%2520%253D%2520%2527JAPAC%2527%29%2520AND%2520%28country%2520%253D%2520%2527South%2520Korea%2527%29%2520AND%2520%28>state%20%3D%20%27Daegu%20Gwang%27%27yeogsi%20%5BTaegu-Kwangyokshi%5D%27))&TIME_=1583320599330&viewparams=&WIDTH=512&HEIGHT=512&CRS=EPSG%3A3857&STYLES=&BBOX=10018754.17139462%2C0%2C15028131.257091932%2C5009377.085697311

Any ideas, how could I configure my filter, so it works in all cases?

Best Regards
Martyna Kolaczek





DXC Technology Company -- This message is transmitted to you by or on behalf of 
DXC Technology Company or one of its affiliates. It is intended exclusively for 
the addressee. The substance of this message, along with any attachments, may 
contain proprietary, confidential or privileged information or information that 
is otherwise legally exempt from disclosure. Any unauthorized review, use, 
disclosure or distribution is prohibited. If you are not the intended recipient 
of this message, you are not authorized to read, print, retain, copy or 
disseminate any part of this message. If you have received this message in 
error, please destroy and delete all copies and notify the sender by return 
e-mail. Regardless of content, this e-mail shall not operate to bind DXC 
Technology Company or any of its affiliates to any order or other contract 
unless pursuant to explicit written agreement or government initiative 
expressly permitting the use of e-mail for such purpose. --.
_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/<https://clicktime.symantec.com/3HQ6uNeRvzUYdr76PxpBJB37Vc?u=http%3A%2F%2Fwww.ianturton.com%2Ftalks%2Ffoss4g.html%23%2F>
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html<https://clicktime.symantec.com/3Acye9pMR5zGLFxsGZZruUe7Vc?u=http%3A%2F%2Fgeoserver.org%2Fcomm%2Fuserlist-guidelines.html>

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer<https://clicktime.symantec.com/3EMc8it1GmFGf9DC7rcCTdZ7Vc?u=https%3A%2F%2Fgithub.com%2Fgeoserver%2Fgeoserver%2Fwiki%2FSuccessfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer>


[email protected]<mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/geoserver-users<https://clicktime.symantec.com/32uAHN25uXx871zNpFcRrym7Vc?u=https%3A%2F%2Flists.sourceforge.net%2Flists%2Flistinfo%2Fgeoserver-users>


--

Regards, Andrea Aime == GeoServer Professional Services from the experts! Visit 
http://goo.gl/it488V<https://clicktime.symantec.com/3XcEvqcnhJvyxv43vLx9Mmm7Vc?u=http%3A%2F%2Fgoo.gl%2Fit488V>
 for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions 
S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) phone: +39 0584 962313 fax: 
+39 0584 1660272 mob: +39 339 8844549 
http://www.geo-solutions.it<https://clicktime.symantec.com/3VmoN6YaMxLYYz2q4wL2rhm7Vc?u=http%3A%2F%2Fwww.geo-solutions.it>
 
http://twitter.com/geosolutions_it<https://clicktime.symantec.com/3CN48m3KrUCRk7cfkWzxjU37Vc?u=http%3A%2F%2Ftwitter.com%2Fgeosolutions_it>
 ------------------------------------------------------- Con riferimento alla 
normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento 
generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza 
inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è 
un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo 
scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, 
ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene 
notizia. This email is intended only for the person or entity to which it is 
addressed and may contain information that is privileged, confidential or 
otherwise protected from disclosure. We remind that - as provided by European 
Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or 
the information herein by anyone other than the intended recipient is 
prohibited. If you have received this email by mistake, please notify us 
immediately by telephone or e-mail.
_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to