On Wednesday, February 27, 2013 08:21:51 AM Justin Deoliveira wrote:
> Hey Mauricio!
> 
> Thanks for the response. Some comments inline.
> 
> On Wed, Feb 27, 2013 at 4:24 AM, Mauricio Pazos 
<[email protected]>wrote:
> > **
> > 
> > On Tuesday, February 26, 2013 09:01:52 PM Justin Deoliveira wrote:
> > > Hi folks,
> > > 
> > > 
> > > 
> > > Unless i am mistaken it is not currently possible to create a simple
> > 
> > equals
> > 
> > > filter that involves a date literal? Quite simply what I would like to
> > > do
> > > 
> > > is be able to parse a filter like:
> > >   foo = 2006-12-31T01:30:00Z
> > 
> > Right, the valid predicated are
> > 
> > <temporal predicate> ::=
> > 
> >     <attribute_name> "BEFORE" <date-time expression>
> >     
> >   | <attribute_name> "BEFORE OR DURING" <period>
> >   | 
> >   | <attribute_name> "DURING" <period>
> >   | 
> >   | <attribute_name> "DURING OR AFTER" <period>
> >   | 
> >   | <attribute_name> "AFTER" <date-time expression>
> > > 
> > > I tried expressing this filter with the existing temporal predicates but
> > > 
> > > couldn't figure out a way to do it.
> > 
> > Did you try DURING? something like:
> > 
> > 
> > 
> > foo DURING 2006-12-31T01:30:00Z/2006-12-31T01:30:00Z
> 
> I did try this. Unfortunately it doesn't work with an "empty" interval. BUt
> if you make the duration a second it works. And while for a lot of cases i
> imagine that would suffice but it seems kind of a nasty hack.
> 
Agree, this is a limitation of CQL specification so you need that "nasty hack" 
. But geotools have a back door, where we could improve the language

> > > Is there any reason not to support date literals in the existing non
> > > 
> > > temporal predicates?
> > 
> > Well, in the OGC specification the syntax is
> > 
> > <date-time expression ::= <date-time> | <period>
> > 
> > <full_date> ::= <date-year> "-" <date-month> "-" <date-day>
> > 
> > <date-year> ::= <digit><digit><digit><digit>
> > 
> > <date-month> ::= <digit><digit>
> > 
> > <date-day> ::= <digit><digit>
> > 
> > 
> > 
> > I think we could add a new predicate
> > 
> > ::= <attribute_name> EQUAL <date-time expression>
> > 
> > To CQL
> 
> Cool. So you prefer using the "EQUAL" term as opposed to normal "=". In the
> patch i threw together the idea was to make a date/datetime expression a
> valid literal, and it seems to work ok. The nice thing about this approach
> is that it works with all the simple comparison operators.
Understood,  but from my view point, we should maintain the "temporal 
predicate" concept to avoid confusion (clash between rules, ambiguous rules, 
... ) 

> 
> > > Anyways, I took a crack at a patch for this:
> > https://github.com/jdeolive/geotools/commit/70bfc8819fc8751382f9e75f4ecd29
> > 3f> 
> > > eec0c280
> > > 
> > > 
> > > 
> > > But fully admin i am not very familiar with the CQL module so my
> > > approach
> > > 
> > > might be way off.
> > 
> > OK, I will have a look this week
> > 
> > > -Justin
> > 
> > --
> > 
> > Mauricio Pazos
-- 
Mauricio Pazos

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
GeoTools-Devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to