CQL BBOX filter cannot be transformed into XML

Description

This is an odd one; using the CQL command line tool cannot handle one of its example expressions.

To reproduce enter the the following:

CQL Filter Tester ("quit" to finish)
>BBOX(ATTR1, 10.0,20.0,30.0,40.0)
>ERROR: 'Cannot encode com.vividsolutions.jts.geom.Envelope should be Filter or Expression'
javax.xml.transform.TransformerException: java.lang.IllegalArgumentException: Cannot encode com.vividsolutions.jts.geom.Envelope should be Filter or Expression
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:670)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:300)
at org.geotools.xml.transform.TransformerBase$Task.run(TransformerBase.java:296)
at org.geotools.xml.transform.TransformerBase.transform(TransformerBase.java:129)
at org.geotools.xml.transform.TransformerBase.transform(TransformerBase.java:108)
at org.geotools.filter.text.cql2.CQL.main(CQL.java:264)
Caused by: java.lang.IllegalArgumentException: Cannot encode com.vividsolutions.jts.geom.Envelope should be Filter or Expression
at org.geotools.filter.FilterTransformer$FilterTranslator.encode(FilterTransformer.java:464)
at org.geotools.filter.FilterTransformer$FilterTranslator.visit(FilterTransformer.java:303)
at org.geotools.filter.spatial.BBOXImpl.accept(BBOXImpl.java:204)
at org.geotools.filter.FilterTransformer$FilterTranslator.encode(FilterTransformer.java:457)
at org.geotools.xml.transform.TransformerBase$XMLReaderSupport.parse(TransformerBase.java:714)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdentity(TransformerImpl.java:607)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:661)
... 5 more
--------- java.lang.IllegalArgumentException: Cannot encode com.vividsolutions.jts.geom.Envelope should be Filter or Expression
at org.geotools.filter.FilterTransformer$FilterTranslator.encode(FilterTransformer.java:464)
at org.geotools.filter.FilterTransformer$FilterTranslator.visit(FilterTransformer.java:303)
at org.geotools.filter.spatial.BBOXImpl.accept(BBOXImpl.java:204)
at org.geotools.filter.FilterTransformer$FilterTranslator.encode(FilterTransformer.java:457)
at org.geotools.xml.transform.TransformerBase$XMLReaderSupport.parse(TransformerBase.java:714)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdentity(TransformerImpl.java:607)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:661)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:300)
at org.geotools.xml.transform.TransformerBase$Task.run(TransformerBase.java:296)
at org.geotools.xml.transform.TransformerBase.transform(TransformerBase.java:129)
at org.geotools.xml.transform.TransformerBase.transform(TransformerBase.java:108)
at org.geotools.filter.text.cql2.CQL.main(CQL.java:264)

The FilterTransformer method fails here:

extraData) {
Expression left = filter.getExpression1();
Expression right = filter.getExpression2();

;
start(type);
left.accept(,extraData);
Literal){
Literal literal = (Literal) right;
Envelope bbox = literal.evaluate(, Envelope.class);
){
encode( bbox ); line fails
}
{
right.accept(,extraData);
}
}
{
right.accept(,extraData);
}
end(type);
extraData;
}

Environment

None

Assignee

Unassigned

Reporter

codehaus

Triage

None

Components

Affects versions

Priority

Medium
Configure