Hi Mark,
quick check, have you tried writing "ID" instead of ID in your CQL?

Cheers
Andrea

On Tue, Dec 15, 2015 at 9:46 AM, Mark Prins <[email protected]> wrote:

> Hi all,
> I just want to check this with you;
>
> I have a (postgis) table with fields
> <ID>, <GEOM>, <PK_KEY>, <TIMESTAMP>,...
> that is joined to a view (on <ID>) in our application to provide filtering
> based on the column of the view, eg. the value of a <STATUS>, this filter
> is then created as a CQL statement having an IN query like: ID IN 
> ((7494,8882,8227,7497,8883,7499,6774,7498,14880,17584,14782,7349,...
>
> the filter is then stored in the client session to be provided to
> geoserver as a SLD which looks something like:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <sld:StyledLayerDescriptor xmlns="http://www.opengis.net/sld"; xmlns:sld="
> http://www.opengis.net/sld"; xmlns:ogc="http://www.opengis.net/ogc";
> xmlns:gml="http://www.opengis.net/gml"; version="1.0.0">
>   <sld:NamedLayer>
>     <sld:Name>parcels</sld:Name>
>     <sld:LayerFeatureConstraints>
>       <sld:FeatureTypeConstraint>
>         <sld:FeatureTypeName>parcels</sld:FeatureTypeName>
>         <ogc:Filter>
>           <ogc:FeatureId fid="7494" />
>           <ogc:FeatureId fid="8882" />
>           <ogc:FeatureId fid="8227" />
>           <ogc:FeatureId fid="7497" />
>           <ogc:FeatureId fid="8883" />
>           <ogc:FeatureId fid="7499" />
>           <ogc:FeatureId fid="6774"...
>
>
> As you can see the CQL is transformed to a filter with FeatureId which in
> turn gives an unexpected result in the map, because the CQL we had was
> asking for the values of ID (and not PK_KEY (FID) values)
>
> Looking at ECQLParser the result is logical; my CQL is eventually handled
> by the IdPredicateDeprecated() method to generate the FID filter, basically
> making it impossible to use a field named ID with an IN query (unless ID is
> also primary key).
>
> Now for my question: is there any way around this? I can think of:
> - renaming the <ID> field in the table,
> - rewriting our filter creation logic to produce a list of <PK_KEY> values 
> instead
> of a list of <ID> values
> - rewriting or filter logic to produce a much more verbose list of OR's
>
> But there might be other ways out?
> Mark
>
> --
> Disclaimer;
> This message is just a reflection of what I thought at the time of
> sending. The message may contain information that is not intended for you
> or that you don't understand.
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> GeoTools-GT2-Users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
>


-- 
==
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information.
==

*Geosolutions' Winter Holidays from 24/12 to 6/1*

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39  339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

*AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*

Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo è consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.



The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility  for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.

-------------------------------------------------------
------------------------------------------------------------------------------
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to