<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
Hello,<br>
<br>
I'm not the most familiar with cql, cedric should know more.<br>
But by looking at the test cases, there are a few examples like : <br>
CONTAINS(ATTR1, POINT(1 2))<br>
DISJOINT(the_geom, POINT(1 2))<br>
<br>
I made a try an it seems the first parameter must be the attribute
you refer to.<br>
<br>
<br>
More usually I write them in full java. it's a bit longer but it's
more efficient too.<br>
final GeometryFactory GF = new GeometryFactory();<br>
final FilterFactory2 FF = (FilterFactory2)
FactoryFinder.getFilterFactory(null);<br>
<br>
final Polygon poly =
GF.createPolygon(GF.createLinearRing(new Coordinate[]{<br>
new Coordinate(2,64),<br>
new Coordinate(2,73),<br>
new Coordinate(4,68),<br>
new Coordinate(2,64)}),<br>
new LinearRing[0]);<br>
final Point point = GF.createPoint(new Coordinate(3,
68)); <br>
final Filter filter = FF.contains(FF.literal(poly),
FF.literal(point));<br>
<br>
System.out.println(filter);<br>
System.out.println(filter.evaluate(null));<br>
<br>
hope this helps<br>
<br>
johann<br>
<br>
<br>
Le 16/02/2011 15:35, Westgård Trond a écrit :
<blockquote
cite="mid:B18A54096AA5B54CA4E71C0FCE051C8A051B988A79@exmbx1.imr.no"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<meta name="Generator" content="Microsoft Word 12 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">I tried to test examples
using the CQL and the FilterFactory.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">It works OK for me for
features attributes that are date, string and numbers.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I then selects the
features I should expect (examples of filter text:
“employee_no BETWEEN 1000 AND 8000” etc.)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Now I wanted to use some
geometry operations. I started out using an expression that
should be true always:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">myfilter =
CQL.toFilter(“contains(polygon((2 64,2 73,4 68, 2,64)),
point(3 68))”);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">The exception states
that this expression lacks an operator and is an invalid
filterexpression. (I also tried with st_contains instead of
contains).<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Any of the experts that
could give me a hint – ideally a link to
examples/documentation ???<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Trond Westgård<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Senior Engineer<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Institute of Marine
Research<o:p></o:p></span></p>
<p class="MsoNormal">Bergen, Norway<o:p></o:p></p>
<p class="MsoNormal"><a class="moz-txt-link-abbreviated" href="mailto:trondwe@imr.no">trondwe@imr.no</a><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Geotoolkit mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Geotoolkit@lists.osgeo.org">Geotoolkit@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/geotoolkit">http://lists.osgeo.org/mailman/listinfo/geotoolkit</a>
</pre>
</blockquote>
<br>
</body>
</html>