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

Reply via email to