|
From: Mauricio P. <mau...@ax...> - 2009-11-04 15:27:13
|
On Wednesday 04 November 2009 04:13:35 am Michael Bedward wrote: > No, that doesn't look quite right. With CQL the second geometry has to > be expressed as a WKT string such as POINT(12 34) or LINESTRING(10 10, > 20 10, 20 20). You could do it like this... > > WKTWriter writer = new WKTWriter(); > Geometry geom2 = ... > String cqlPredicate = "CONTAIMS(the_geom, " + writer.write(geom2) + > ")"; Filter filter = CQL.toFilter(cqlPredicate); > Exactly! from http://docs.codehaus.org/display/GEOTOOLS/CQL+Parser+Design <georoutine argument list> ::= <left paren><attribute name><comma><geometry literal><right paren> <geometry literal> := ... The extended syntax implemented in ECQL accepts expressions as arguments: <georoutine argument list> ::= "(" <expression> "," <expression> ")" You could write something like ECQL.toFilter("CONTAINS(buffer(the_geom, 10) , POINT(1 2))") cheers -- Mauricio Pazos www.axios.es |