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
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users