Hi people,

I having troubles with filter encoding of Polygon. In the follwing test, It works well:

LineString ln = gf.createLineString (cArray); // Line String works well
Filter f = ff.contains(ff.property("SERVICEBBOX"), ff.literal(ln));
Or orFilter = ff.or(filter, f);
org.geotools.xml.Configuration configuration = new org.geotools.filter.v1_0.OGCConfiguration();
org.geotools.xml.Encoder encoder = new org.geotools.xml.Encoder( configuration );
//        create an output stream
OutputStream xml = new FileOutputStream("C:\\eclipse\\workspace\\WebServiceDescriptionTool2\\src\\test\\geoTest4.xml");
//        encode
encoder.encode( orFilter, org.geotools.filter.v1_0.OGC.Filter, xml );



The xml encoding generated is :


<ogc:Contains>
            <ogc:PropertyName>SERVICEBBOX</ogc:PropertyName>
            <gml:LineString>
                <gml:coordinates>-38.0,-7.0 -36.0,-7.0</gml:coordinates>
            </gml:LineString>
  </ogc:Contains>

But, when I use Polygon (and I think that I forgetting anything else) the geotools not have generated the correct encoding, follows the java code:

Coordinate [] cArray = {c, c2, c3, c4};
LinearRing ln = gf.createLinearRing(cArray);
Polygon pol = gf.createPolygon(ln, null);
Filter f = ff.contains(ff.property ("SERVICEBBOX"), ff.literal(pol));
Or orFilter = ff.or(filter, f);
org.geotools.xml.Configuration configuration = new org.geotools.filter.v1_0.OGCConfiguration();
org.geotools.xml.Encoder encoder = new org.geotools.xml.Encoder( configuration );
//        create an output stream
OutputStream xml = new FileOutputStream("C:\\eclipse\\workspace\\WebServiceDescriptionTool2\\src\\test\\geoTest4.xml");
//        encode
encoder.encode( orFilter, org.geotools.filter.v1_0.OGC.Filter, xml );


Follows the xml encoding:

<ogc:Contains>
            <ogc:PropertyName>SERVICEBBOX</ogc:PropertyName>
            <gml:Polygon /> <!-- Polygon isn't well generated  -->
</ogc:Contains>


Anyone knows what is wrong ? Or What's happening ?

Thank's in advance !

--
Fábio Luiz Leite Júnior