For backward compatibility, it might be an option to change the order of the token evaluations of INTEGER and DE9IM_PATTERN. An DE9IM_PATTERN consisting of all integers is extremely unlikely, so it might be better to change the parser order by putting DE9IM_PATTERN after INTEGER. People that really need an all-integer DE9IM_PATTERN could use the escape construct, of course.

Cheers,
Jan
On 17/05/2013 11:26, Kristof Heirwegh wrote:
Hello kind people of Geotools,

After upgrading to Geotools version 9.2 (from 2.7.5) we had a problem with all our samples because of GEOT-4211 (CQL Filter fails when certain values are passed). I took a look at the grammar files and saw that the newly (since 8.x) added relate filter functionality conflicts with the parsing of integers.

TOKEN [IGNORE_CASE]:
{
    < #DIMENSION_SYMBOL: "*"| "T" | "F" | "0" | "1" | "2"> |
< DE9IM_PATTERN: <DIMENSION_SYMBOL><DIMENSION_SYMBOL><DIMENSION_SYMBOL><DIMENSION_SYMBOL><DIMENSION_SYMBOL><DIMENSION_SYMBOL><DIMENSION_SYMBOL><DIMENSION_SYMBOL><DIMENSION_SYMBOL> >
}

Which overlaps with 9 digit integers existing of only 0, 1 & 2.


If I add left and right square brackets everything works fine, this does however change the syntax of the Relate function.

TOKEN [IGNORE_CASE]:
{
    < #DIMENSION_SYMBOL: "*"| "T" | "F" | "0" | "1" | "2"> |
< DE9IM_PATTERN: *<LSP>*<DIMENSION_SYMBOL><DIMENSION_SYMBOL><DIMENSION_SYMBOL><DIMENSION_SYMBOL><DIMENSION_SYMBOL><DIMENSION_SYMBOL><DIMENSION_SYMBOL><DIMENSION_SYMBOL><DIMENSION_SYMBOL>*<RSP>*>
}

Sample:
RELATE(the_geom, LINESTRING (-134.921387 58.687767, -135.303391 59.092838), T*****FF*)

becomes:
RELATE(the_geom, LINESTRING (-134.921387 58.687767, -135.303391 59.092838), [T*****FF*])


I took brackets because the pattern represents a matrix, but it could also be something else (quotes for instance (making it a string)).


Thought / Remarks?

If you like I can make a patch, but changing syntax probably needs some discussion / more formal way of handling, as it will break your code if you use the relate filter.



Sincerely
Kristof Heirwegh


DFC Software Engineering
Brugsesteenweg 587
9030 Gent
T: +32 (0)9 236 61 96
F: +32 (0)9 236 54 12
W: _www.dfc.be_






------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d


_______________________________________________
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel


--
Sincerely,
Jan De Moerloose

Geosparc n.v.
http://www.geosparc.com
sponsor of http://www.geomajas.org

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to