LikeFilter AND encoding
-----------------------

                 Key: GEOT-2580
                 URL: http://jira.codehaus.org/browse/GEOT-2580
             Project: GeoTools
          Issue Type: Bug
          Components: core xml
    Affects Versions: 2.5.5
            Reporter: Roy Braam


When you try to create a AND filter of PropertyIsLike filters the filter tag 
only has 1 and tag: If done with a  propertyIsEqualTo filter it's ok.

 public static void main(String[] args) throws IOException {
        FilterFactory2 ff = 
CommonFactoryFinder.getFilterFactory2(GeoTools.getDefaultHints());
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        org.geotools.xml.Configuration configuration2 = new OGCConfiguration();
        org.geotools.xml.Encoder encoder = new 
org.geotools.xml.Encoder(configuration2);

        //create filters:
        ArrayList al = new ArrayList();
        for (int i = 0; i < 4; i++) {
            //al.add(ff.equals(ff.property("number"), ff.literal("number"+i)));
            al.add(ff.like(ff.property("number"), "number"+i));
        }
        //make and filter
        Filter andFilter = ff.and(al);
        //encode
        encoder.encode(andFilter, org.geotools.filter.v1_1.OGC.Filter, baos);
        String s = baos.toString();
        System.out.println("Equal filter: /n" + s);
    }

Output:
<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"; 
xmlns:gml="http://www.opengis.net/gml";><ogc:And/></ogc:Filter>



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to