Details
Description
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++)
//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>