Am 24.06.2011 12:59, schrieb Andrea Aime:
> On Fri, Jun 24, 2011 at 11:21 AM, Matthias Lendholt
> <[email protected]>  wrote:
>> Hi all,
>>
>> is it possible to define a org.opengis.filter.Filter or
>> org.geotools.data.Query with a DE9IM expression ?
>
> You should use the "relatePattern" filter function in your filter, but
> beware filter
> functions are evaluated in memory, so you also want to and to it a bbox filter
> that extracts the features that can potentially have some relationship with
> the reference one (the bbox one will be sent to the db/shapefile)
>
> In CQL it would be something like:
>
> bbox('the_geom', x1, y1, y2, y2) and relatePattern('the_geom',
> <reference_geometry>, 'DE9IMPattern')

Hi Andrea,
Could you specify the syntax and parameter order for the relatePattern? 
  I'm always ending up in a CQLException thrown during parsing of my 
expression.

I thought it would be
  CQL.toFilter("relatePattern(the_geom,"                                        
                + refGeomAsWKT+ ",'" + 
de9impattern + "')");

but in this case it ends up

org.geotools.process.ProcessException: 
org.geotools.filter.text.cql2.CQLException: Encountered "LINESTRING" at 
line 1, column 25.
Was expecting one of:
     <STRING_LITERAL> ...
     "true" ...
     "false" ...
     "(" ...
     "[" ...
     <INTEGER_LITERAL> ...
     <FLOATING_LITERAL> ...
     <IDENTIFIER> ...
     . Parsing : relatePattern(the_geom, LINESTRING (27.3 37, 27.3 
37.6),'***1*****'). Current Token : ","


Many thanks!
Matthias

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to