List,

I use geotools version 2.5.2. 
I think this is a bug in the LikeFilterImpl:

If i create a propertyIsLike(LikeFilterImpl) filter i get a empty filter tag 
when the filter is encoded. Am i using the right functions?

A simple piece of code:

FilterFactory2 ff = 
CommonFactoryFinder.getFilterFactory2(GeoTools.getDefaultHints());

PropertyIsEqualTo 
filterEqual=ff.equals(ff.property("city"),ff.literal("Amsterdam"));
encoder.encode(filterEqual,org.geotools.filter.v1_1.OGC.Filter,baos);
String s= baos.toString();
System.out.println("Equal filter: /n"+s);

org.geotools.xml.Configuration configuration2= new 
org.geotools.filter.v1_0.OGCConfiguration();
org.geotools.xml.Encoder encoder2 = new org.geotools.xml.Encoder( 
configuration2 );
ByteArrayOutputStream b = new ByteArrayOutputStream();
Filter filterLike=ff.like(ff.property("city"),"Amsterdam");
            
encoder2.encode(filterLike,org.geotools.filter.v1_1.OGC.Filter,b);
String s2= b.toString();
System.out.print("Like filter: /n"+s2);


Output:
Equal filter: /n<?xml version="1.0" encoding="UTF-8"?>
<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"; 
xmlns:gml="http://www.opengis.net/gml"; 
xmlns:xml="http://www.w3.org/XML/1998/namespace";><ogc:PropertyIsEqualTo><ogc:PropertyName>woonplaats</ogc:PropertyName><ogc:Literal>Heerlen</ogc:Literal></ogc:PropertyIsEqualTo></ogc:Filter>
Like filter: /n<?xml version="1.0" encoding="UTF-8"?>
<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"; 
xmlns:gml="http://www.opengis.net/gml"; 
xmlns:xml="http://www.w3.org/XML/1998/namespace"/>

As you can see the second filter (like filter) is a empty filter tag.
LikeFilterImpl extends AbstractFilter doesn't this needs to be 
CompareFilterImpl?

Tia

Roy  
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to