From: Gabriel <gr...@ax...> - 2007-01-25 21:34:45
Attachments:
gt2-api.patch
gt2-main.patch
|
Hi all, I'm being asked by Andrea to back port the CQL module from trunk to 2.3.x s= o=20 we can use it on GeoServer 1.5.x So I went ahead and did it on my box. Now, I had to fill a couple holes in= =20 Expr.java in order to actually create functions, and had to add boolean and= =20 date literal types for LiteralExpression. Attached are the patches that make the trick. Applying them on my box and=20 running mvn clean install from the root pom works just fine. Please review as I'm waiting for the go ahead or not to commit this changes= =20 and upload the cql module on trunk. Cheers, Gabriel =2D-=20 Gabriel Rold=E1n (gr...@ax...) Axios Engineering (http://www.axios.es) Tel. +34 944 41 63 84 =46ax. +34 944 41 64 90 |
From: Andrea A. <aa...@op...> - 2007-01-25 22:15:26
|
Gabriel Rold=E1n ha scritto: > Hi all, >=20 > I'm being asked by Andrea to back port the CQL module from trunk to 2.3= .x so=20 > we can use it on GeoServer 1.5.x Yup, I'd like to have it for the WMS GetMap with filter implementation. It would be a nice extra for the WFS GetFeature GET calls too imho. In the long run, I'd like to have a console that allows users to setup a Query with a form and have a downloadable file as a result (a=20 GetFeature builder UI), but that's something for 1.6.x onwards. > So I went ahead and did it on my box. Now, I had to fill a couple holes= in=20 > Expr.java in order to actually create functions, and had to add boolean= and=20 > date literal types for LiteralExpression. >=20 > Attached are the patches that make the trick. Applying them on my box a= nd=20 > running mvn clean install from the root pom works just fine. >=20 > Please review as I'm waiting for the go ahead or not to commit this cha= nges=20 > and upload the cql module on trunk. They all seem to me simple patches, +1 from my side. Cheers Andrea |
From: Gabriel <gr...@ax...> - 2007-02-10 00:22:48
|
Hi Andrea, I just backported the cql module to 2.3.x. Out of the build by now though,= =20 until we figure out that expression language factory stuff Jody talks=20 about... Jody: do you really think it is worth right now? if so, suggestions=20 appreciated. cheers, Gabriel On Thursday 25 January 2007 23:15, Andrea Aime wrote: > Gabriel Rold=E1n ha scritto: > > Hi all, > > > > I'm being asked by Andrea to back port the CQL module from trunk to 2.3= =2Ex > > so we can use it on GeoServer 1.5.x > > Yup, I'd like to have it for the WMS GetMap with filter implementation. > It would be a nice extra for the WFS GetFeature GET calls too imho. > In the long run, I'd like to have a console that allows users to setup > a Query with a form and have a downloadable file as a result (a > GetFeature builder UI), but that's something for 1.6.x onwards. > > > So I went ahead and did it on my box. Now, I had to fill a couple holes > > in Expr.java in order to actually create functions, and had to add > > boolean and date literal types for LiteralExpression. > > > > Attached are the patches that make the trick. Applying them on my box a= nd > > running mvn clean install from the root pom works just fine. > > > > Please review as I'm waiting for the go ahead or not to commit this > > changes and upload the cql module on trunk. > > They all seem to me simple patches, +1 from my side. > Cheers > Andrea =2D-=20 Gabriel Rold=E1n (gr...@ax...) Axios Engineering (http://www.axios.es) Tel. +34 944 41 63 84 =46ax. +34 944 41 64 90 |
From: Jody G. <jga...@re...> - 2007-02-10 00:34:00
|
Hi Gabriel we should put CQL into the api and data module on trunk. We can do this now if you are game and have time. The expression language stuff is a direction for "data access" to walk in (since other query languages besides CQL are supported by catalogs for example); it has no effect on CQL being a good idea (or good way to make expressions). We should *not* backport to 2.3.x - 2.3.0 is frozen. The reason some grid coverage work was able to happen was because no API changes were made (and if they were it was a mistake due to communication). Cheers, Jody > Hi Andrea, > I just backported the cql module to 2.3.x. Out of the build by now though, > until we figure out that expression language factory stuff Jody talks > about... > > Jody: do you really think it is worth right now? if so, suggestions > appreciated. > > cheers, > > Gabriel > > On Thursday 25 January 2007 23:15, Andrea Aime wrote: > >> Gabriel Roldán ha scritto: >> >>> Hi all, >>> >>> I'm being asked by Andrea to back port the CQL module from trunk to 2.3.x >>> so we can use it on GeoServer 1.5.x >>> >> Yup, I'd like to have it for the WMS GetMap with filter implementation. >> It would be a nice extra for the WFS GetFeature GET calls too imho. >> In the long run, I'd like to have a console that allows users to setup >> a Query with a form and have a downloadable file as a result (a >> GetFeature builder UI), but that's something for 1.6.x onwards. >> >> >>> So I went ahead and did it on my box. Now, I had to fill a couple holes >>> in Expr.java in order to actually create functions, and had to add >>> boolean and date literal types for LiteralExpression. >>> >>> Attached are the patches that make the trick. Applying them on my box and >>> running mvn clean install from the root pom works just fine. >>> >>> Please review as I'm waiting for the go ahead or not to commit this >>> changes and upload the cql module on trunk. >>> >> They all seem to me simple patches, +1 from my side. >> Cheers >> Andrea >> > > |
From: Justin D. <jde...@op...> - 2007-01-26 15:00:19
|
Patch looks good Gabriel. Gabriel Rold=E1n wrote: > Hi all, >=20 > I'm being asked by Andrea to back port the CQL module from trunk to 2.3= .x so=20 > we can use it on GeoServer 1.5.x >=20 > So I went ahead and did it on my box. Now, I had to fill a couple holes= in=20 > Expr.java in order to actually create functions, and had to add boolean= and=20 > date literal types for LiteralExpression. >=20 > Attached are the patches that make the trick. Applying them on my box a= nd=20 > running mvn clean install from the root pom works just fine. >=20 > Please review as I'm waiting for the go ahead or not to commit this cha= nges=20 > and upload the cql module on trunk. >=20 > Cheers, >=20 > Gabriel >=20 >=20 > -----------------------------------------------------------------------= - >=20 > Index: /home/gabriel/workspaces/svn/geotools/2.3.x/module/api/src/org/g= eotools/filter/ExpressionType.java > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- /home/gabriel/workspaces/svn/geotools/2.3.x/module/api/src/org/geot= ools/filter/ExpressionType.java (revision 24044) > +++ /home/gabriel/workspaces/svn/geotools/2.3.x/module/api/src/org/geot= ools/filter/ExpressionType.java (working copy) > @@ -44,6 +44,12 @@ > /** Defines a literal expression with a declared long type. */ > public static final short LITERAL_LONG =3D 100; > =20 > + /** Defines a literal expression with a declared Boolean type. */ > + public static final short LITERAL_BOOLEAN =3D 115; > + > + /** Defines a literal expression with a declared java.util.Date ty= pe. */ > + public static final short LITERAL_DATE =3D 116; > + > /* Types implemented by ExpressionMath. */ > /** Defines a math expression for adding. */ > public static final short MATH_ADD =3D 105; >=20 >=20 > -----------------------------------------------------------------------= - >=20 > Index: /home/gabriel/workspaces/svn/geotools/2.3.x/module/main/src/org/= geotools/filter/Expr.java > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- /home/gabriel/workspaces/svn/geotools/2.3.x/module/main/src/org/geo= tools/filter/Expr.java (revision 24044) > +++ /home/gabriel/workspaces/svn/geotools/2.3.x/module/main/src/org/geo= tools/filter/Expr.java (working copy) > @@ -17,10 +17,13 @@ > =20 > import java.util.ArrayList; > import java.util.Arrays; > +import java.util.HashMap; > +import java.util.Iterator; > import java.util.List; > +import java.util.Map; > import java.util.Set; > =20 > -import org.geotools.filter.FilterFactory; > +import org.geotools.factory.Hints; > import org.geotools.filter.expression.AddImpl; > import org.geotools.filter.expression.DivideImpl; > import org.geotools.filter.expression.MultiplyImpl; > @@ -114,6 +117,8 @@ > */ > public abstract class Expr implements FilterFactory { > =20 > + private FunctionFinder functionFinder =3D new FunctionFinder(null); > +=09 > public And and(Filter f, Filter g ) { > List/*<Filter>*/ list =3D new ArrayList/*<Filter>*/( 2 ); > list.add( f ); > @@ -392,18 +397,20 @@ > } > =20 > public Function function(String name, Expression[] args) { > - //TODO: Auto-generated method stub > - return null; > + Function function =3D functionFinder.findFunction( name, Arrays.asLi= st(args) ); > + return function; > } > =20 > +=09 > public Function function(String name, Expression arg1) { > - // TODO Auto-generated method stub > - return null; > - } > + Function function =3D functionFinder.findFunction( name, Arrays.asLi= st( new Expression[]{ arg1 } ) ); > + return function; > + } > =20 > public Function function(String name, Expression arg1, Expression arg= 2) { > - // TODO Auto-generated method stub > - return null; > + Function function =3D=20 > + functionFinder.findFunction( name, Arrays.asList( new Expres= sion[]{ arg1, arg2 }) ); > + return function; > } > =20 > public Function function(String name, Expression arg1, Expression arg= 2, > @@ -408,8 +415,10 @@ > =20 > public Function function(String name, Expression arg1, Expression arg= 2, > Expression arg3) { > - // TODO Auto-generated method stub > - return null; > + Function function =3D=20 > + functionFinder.findFunction( name, Arrays.asList( new Express= ion[]{ arg1, arg2, arg3 }) ); > + =20 > + return function; > } > =20 > public Literal literal(Object obj) { > @@ -417,10 +426,10 @@ > return new LiteralExpressionImpl(obj); > }=20 > catch (IllegalFilterException e) { > - new IllegalArgumentException().initCause(e); > + throw (RuntimeException)new IllegalArgumentException().initCause(e)= ; > } > =09 > - return null; > + //return null; > } > =20 > public Literal literal(byte b) { > @@ -455,4 +464,87 @@ > throw new UnsupportedOperationException("Filter api does not support= boolean literals"); > } > =20 > + > + /** > + * Isolate function lookup code from Factory implementation(s). > + * <p> > + * This is done to look for two things: > + * <ul> > + * <li>org.geotools.filter.Function > + * <li>org.opengis.filter.expression.Function > + * </ul> > + * This is done as a proper utility class that accepts Hints. > + *=20 > + * @author Jody Garnett > + */ > + private static class FunctionFinder { > + private Map functionExpressionCache; > + > + private Map functionImplCache; > + > + public FunctionFinder(Hints hints) { > + // currently hints are not used, need help :-P > + } > + > + public Function findFunction(String name) { > + return findFunction(name, null); > + } > + > + public Function findFunction(String name, List/* <Expression> */p= arameters) { > + name =3D functionName(name); > + > + try { > + // load the caches at first access > + if (functionExpressionCache =3D=3D null) { > + functionExpressionCache =3D new HashMap(); > + functionImplCache =3D new HashMap(); > + > + for (Iterator it =3D org.geotools.factory.FactoryFind= er > + .factories(FunctionExpression.class); it.hasN= ext();) { > + FunctionExpression function =3D (FunctionExpressi= on) it.next(); > + functionExpressionCache.put(function.getName().to= LowerCase(), function.getClass()); > + } > + for (Iterator i =3D org.geotools.factory.FactoryFinde= r.factories(FunctionExpression.class);=20 > + i.hasNext();) { > + FunctionExpression function =3D (FunctionExpression)= i.next(); > + functionImplCache.put(function.getName().toLowerC= ase(), function.getClass()); > + } > + } > + =20 > + // cache lookup > + Class clazz =3D (Class) functionExpressionCache.get(name.= toLowerCase()); > + if(clazz !=3D null) { > + FunctionExpression function =3D (FunctionExpression) = clazz.newInstance(); > + if(parameters !=3D null) > + function.setArgs((org.geotools.filter.Expression[= ]) parameters.toArray(new org.geotools.filter.Expression[]{})); > + return function; > + } > + clazz =3D (Class) functionImplCache.get(name.toLowerCase(= )); > + if(clazz !=3D null) { > + FunctionExpression function =3D (FunctionExpression) cla= zz.newInstance(); > + if(parameters !=3D null) > + function.setArgs((org.geotools.filter.Expression[= ]) parameters.toArray(new org.geotools.filter.Expression[]{})); > + return function; > + } =20 > + =20 > + } catch (Exception e) { > + throw new RuntimeException("Unable to create class " + na= me + "Function", e); > + } > + throw new RuntimeException("Unable to find function " + name)= ; > + } > + > + private String functionName(String name) { > + int index =3D -1; > + > + if ((index =3D name.indexOf("Function")) !=3D -1) { > + name =3D name.substring(0, index); > + } > + > + name =3D name.toLowerCase().trim(); > + char c =3D name.charAt(0); > + name =3D name.replaceFirst("" + c, "" + Character.toUpperCase= (c)); > + > + return name; > + } > + } > } > Index: /home/gabriel/workspaces/svn/geotools/2.3.x/module/main/src/org/= geotools/filter/LiteralExpressionImpl.java > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- /home/gabriel/workspaces/svn/geotools/2.3.x/module/main/src/org/geo= tools/filter/LiteralExpressionImpl.java (revision 24044) > +++ /home/gabriel/workspaces/svn/geotools/2.3.x/module/main/src/org/geo= tools/filter/LiteralExpressionImpl.java (working copy) > @@ -15,6 +15,8 @@ > */ > package org.geotools.filter; > =20 > +import java.util.Date; > + > import org.geotools.feature.Feature; > import org.opengis.filter.expression.ExpressionVisitor; > =20 > @@ -181,6 +183,10 @@ > expressionType =3D LITERAL_STRING; > } else if (literal instanceof Geometry) { > expressionType =3D LITERAL_GEOMETRY; > + } else if (literal instanceof Boolean) { > + expressionType =3D LITERAL_BOOLEAN; > + } else if (literal instanceof Date) { > + expressionType =3D LITERAL_DATE; > } else { > =09 > =20 > @@ -255,6 +261,12 @@ > } else if (expressionType =3D=3D LITERAL_DOUBLE) { > return ((Double) this.literal).equals((Double) expLit > .getLiteral()); > + } else if (expressionType =3D=3D LITERAL_BOOLEAN) { > + return ((Boolean) this.literal).equals((Boolean) expLi= t > + .getLiteral()); > + }else if (expressionType =3D=3D LITERAL_DATE) { > + return ((Date) this.literal).equals((Date) expLit > + .getLiteral()); > } else { > return true; > } >=20 >=20 > -----------------------------------------------------------------------= - >=20 > -----------------------------------------------------------------------= -- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share= your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D= DEVDEV >=20 > !DSPAM:1004,45b92455119221775926497! >=20 >=20 > -----------------------------------------------------------------------= - >=20 > _______________________________________________ > Geotools-devel mailing list > Geo...@li... > https://lists.sourceforge.net/lists/listinfo/geotools-devel >=20 >=20 > !DSPAM:1004,45b92455119221775926497! --=20 Justin Deoliveira jde...@op... The Open Planning Project http://topp.openplans.org |
From: Gabriel <gr...@ax...> - 2007-01-26 16:39:23
|
cool, would wait for Jody's go ahead anyway as Filter maintainer. Another thing I have to ask for (Jody ping) is to move cql to supported lan= d.=20 Pending task was to upload some user doc, which is done at=20 http://docs.codehaus.org/display/GEOTOOLS/CQL+Samples If I got your ok should I move it to /extensions or to /plugins? I guess=20 extensions. Cheers, Gabriel On Thursday 25 January 2007 23:15, Andrea Aime wrote: > Gabriel Rold=E1n ha scritto: > > Hi all, > > > > I'm being asked by Andrea to back port the CQL module from trunk to 2.3= =2Ex > > so we can use it on GeoServer 1.5.x > > Yup, I'd like to have it for the WMS GetMap with filter implementation. > It would be a nice extra for the WFS GetFeature GET calls too imho. > In the long run, I'd like to have a console that allows users to setup > a Query with a form and have a downloadable file as a result (a > GetFeature builder UI), but that's something for 1.6.x onwards. > > > So I went ahead and did it on my box. Now, I had to fill a couple holes > > in Expr.java in order to actually create functions, and had to add > > boolean and date literal types for LiteralExpression. > > > > Attached are the patches that make the trick. Applying them on my box a= nd > > running mvn clean install from the root pom works just fine. > > > > Please review as I'm waiting for the go ahead or not to commit this > > changes and upload the cql module on trunk. > > They all seem to me simple patches, +1 from my side. > Cheers > Andrea =2D-=20 Gabriel Rold=E1n (gr...@ax...) Axios Engineering (http://www.axios.es) Tel. +34 944 41 63 84 =46ax. +34 944 41 64 90 |
From: Jody G. <jga...@re...> - 2007-01-26 17:45:23
|
Thanks Gabriel; Yes I am ready - we have a naming conflict with two=20 FilterBuilder implementations (you note I was assuming the CQL would=20 work when I defined the new DataAccess api :-) ) Can we deal with this next week (yawn) when I will have my brain back ... Points to check; we need to create a Factory for "QueryLanguage" and=20 place your module into plugins (the catalog spec refers to other query=20 languages and I would like to design for this from the get go...). Cheers, Jody > cool, would wait for Jody's go ahead anyway as Filter maintainer. > Another thing I have to ask for (Jody ping) is to move cql to supported= land.=20 > Pending task was to upload some user doc, which is done at=20 > http://docs.codehaus.org/display/GEOTOOLS/CQL+Samples > > If I got your ok should I move it to /extensions or to /plugins? I gues= s=20 > extensions. > > Cheers, > > Gabriel > > On Thursday 25 January 2007 23:15, Andrea Aime wrote: > =20 >> Gabriel Rold=E1n ha scritto: >> =20 >>> Hi all, >>> >>> I'm being asked by Andrea to back port the CQL module from trunk to 2= .3.x >>> so we can use it on GeoServer 1.5.x >>> =20 >> Yup, I'd like to have it for the WMS GetMap with filter implementation= . >> It would be a nice extra for the WFS GetFeature GET calls too imho. >> In the long run, I'd like to have a console that allows users to setup >> a Query with a form and have a downloadable file as a result (a >> GetFeature builder UI), but that's something for 1.6.x onwards. >> >> =20 >>> So I went ahead and did it on my box. Now, I had to fill a couple hol= es >>> in Expr.java in order to actually create functions, and had to add >>> boolean and date literal types for LiteralExpression. >>> >>> Attached are the patches that make the trick. Applying them on my box= and >>> running mvn clean install from the root pom works just fine. >>> >>> Please review as I'm waiting for the go ahead or not to commit this >>> changes and upload the cql module on trunk. >>> =20 >> They all seem to me simple patches, +1 from my side. >> Cheers >> Andrea >> =20 > > =20 |
From: Gabriel <gr...@ax...> - 2007-01-26 19:44:55
|
Cool, I need a rest too. Let's raise this up next week. Cheers, Gabriel On Friday 26 January 2007 18:45, Jody Garnett wrote: > Thanks Gabriel; Yes I am ready - we have a naming conflict with two > FilterBuilder implementations (you note I was assuming the CQL would > work when I defined the new DataAccess api :-) ) > > Can we deal with this next week (yawn) when I will have my brain back ... > > Points to check; we need to create a Factory for "QueryLanguage" and > place your module into plugins (the catalog spec refers to other query > languages and I would like to design for this from the get go...). > > Cheers, > Jody > > > cool, would wait for Jody's go ahead anyway as Filter maintainer. > > Another thing I have to ask for (Jody ping) is to move cql to supported > > land. Pending task was to upload some user doc, which is done at > > http://docs.codehaus.org/display/GEOTOOLS/CQL+Samples > > > > If I got your ok should I move it to /extensions or to /plugins? I guess > > extensions. > > > > Cheers, > > > > Gabriel > > > > On Thursday 25 January 2007 23:15, Andrea Aime wrote: > >> Gabriel Rold=E1n ha scritto: > >>> Hi all, > >>> > >>> I'm being asked by Andrea to back port the CQL module from trunk to > >>> 2.3.x so we can use it on GeoServer 1.5.x > >> > >> Yup, I'd like to have it for the WMS GetMap with filter implementation. > >> It would be a nice extra for the WFS GetFeature GET calls too imho. > >> In the long run, I'd like to have a console that allows users to setup > >> a Query with a form and have a downloadable file as a result (a > >> GetFeature builder UI), but that's something for 1.6.x onwards. > >> > >>> So I went ahead and did it on my box. Now, I had to fill a couple hol= es > >>> in Expr.java in order to actually create functions, and had to add > >>> boolean and date literal types for LiteralExpression. > >>> > >>> Attached are the patches that make the trick. Applying them on my box > >>> and running mvn clean install from the root pom works just fine. > >>> > >>> Please review as I'm waiting for the go ahead or not to commit this > >>> changes and upload the cql module on trunk. > >> > >> They all seem to me simple patches, +1 from my side. > >> Cheers > >> Andrea =2D-=20 Gabriel Rold=E1n (gr...@ax...) Axios Engineering (http://www.axios.es) Tel. +34 944 41 63 84 =46ax. +34 944 41 64 90 |
From: Andrea A. <aa...@op...> - 2007-02-10 08:06:08
|
Jody Garnett ha scritto: > Hi Gabriel we should put CQL into the api and data module on trunk. We > can do this now if you are game and have time. > > The expression language stuff is a direction for "data access" to walk > in (since other query languages besides CQL are supported by catalogs > for example); it has no effect on CQL being a good idea (or good way to > make expressions). > > We should *not* backport to 2.3.x - 2.3.0 is frozen. The reason some > grid coverage work was able to happen was because no API changes were > made (and if they were it was a mistake due to communication). Sorry, CQL is a just a new module, not an API change? It's not like adding it we would break existing clients? Anyways, either the CQL on 2.3.x is ready next week, or Gabriel effort to make it available for 1.5.0 will be lost (that would be very sad imho). Cheers Andrea |
From: Gabriel <gr...@ax...> - 2007-02-10 19:44:33
|
Hi, Indeed it is a small self contained module which has no impact on any exist= ing=20 API, so I guess it should be ok to have it as is on 2.3.x so Andrea can use= =20 is for geoserver 1.5.0. Then we can see how it fits on the "data access" idea for trunk, but that's= =20 another history. And since you're proposing it to be a plugin for "query=20 language", it could keep being its own module and implement the machinery=20 needed to plug once it is defined. thoughts? Gabriel On Saturday 10 February 2007 09:05, Andrea Aime wrote: > Jody Garnett ha scritto: > > Hi Gabriel we should put CQL into the api and data module on trunk. We > > can do this now if you are game and have time. > > > > The expression language stuff is a direction for "data access" to walk > > in (since other query languages besides CQL are supported by catalogs > > for example); it has no effect on CQL being a good idea (or good way to > > make expressions). > > > > We should *not* backport to 2.3.x - 2.3.0 is frozen. The reason some > > grid coverage work was able to happen was because no API changes were > > made (and if they were it was a mistake due to communication). > > Sorry, CQL is a just a new module, not an API change? It's not like > adding it we would break existing clients? > Anyways, either the CQL on 2.3.x is ready next week, or Gabriel effort > to make it available for 1.5.0 will be lost (that would be very sad imho). > > Cheers > Andrea =2D-=20 Gabriel Rold=E1n (gr...@ax...) Axios Engineering (http://www.axios.es) Tel. +34 944 41 63 84 =46ax. +34 944 41 64 90 |
From: Jody G. <jga...@re...> - 2007-02-23 17:25:13
|
Cool let me just confirm my thinking with Mauricio then. Mauricio - I like CQL a lot and plan to use it in all the sample code. As such users are going to be using it everywhere. A year from now most won't actually know what a FilterFactory is ... because they never will of used it. As such I would like to pay attention to what the sample code looks like, right down to number of keypresses. And we make the decision on what to call CQLParser based on porting some filter examples into the demo/intro and the user docs? Just a couple of pages should do the trick. Cheers, Jody > Hi Jody, > > On Friday 23 February 2007 01:41, Jody Garnett wrote: > >> Sorry for the delay Gabriel ... >> > no need to apologize > >> a lot of your patch was directed at >> Expr. Is that file still around? trunk says no ... >> > Correct, trunk is ok, I've already fixed the issues with functions and the > like a time ago, and Expr functionality in trunk is directly incorporated in > FilterFactoryImpl. The patch was mainly a backport of the funciton finder on > trunk as an inner class for Expr in 2.3.x, since 2.3.x was not creating > functions at all. > > >> Right now cql is commented out of the build; what needs to happen for it >> to be brought into the build, and then supported? >> > > Guess just changing the name of FilterBuilder to CQL as you suggested. > Mauricio would be happier with CQLParser, but not a great deal anyway. > > So watever of the two seems better we can make the change and move the module > to plugin asap. > > cheers, > > Gabriel > >> Jody >> >> >>> Hi all, >>> >>> I'm being asked by Andrea to back port the CQL module from trunk to 2.3.x >>> so we can use it on GeoServer 1.5.x >>> >>> So I went ahead and did it on my box. Now, I had to fill a couple holes >>> in Expr.java in order to actually create functions, and had to add >>> boolean and date literal types for LiteralExpression. >>> >>> Attached are the patches that make the trick. Applying them on my box and >>> running mvn clean install from the root pom works just fine. >>> >>> Please review as I'm waiting for the go ahead or not to commit this >>> changes and upload the cql module on trunk. >>> >>> Cheers, >>> >>> Gabriel >>> |
From: Victor M. P. <mau...@ax...> - 2007-02-26 10:01:58
|
Hi Jody, I am not sure about if I understand exactly your question. But if the following code: //create the filter filter =filterFactory.createCompareFilter(CompareFilter.COMPARE_GREATER_THAN); FeatureType featureType = features.getFeatures().getSchema(); filter.addLeftValue(filterFactory.createAttributeExpression("POP_2000")); filter.addRightValue(filterFactory.createLiteralExpression(100000)); //count filtered features col = features.getFeatures(filter); it is going to replace by a nicer code using CQL like: col = features.getFeatures("POP_2000 > 100000"); I see the filters creation problems will be hidden, then the name of modules responsible of creation will be part of the internal behavior, and we only must take into account the new class name (currently named FilterBuilder) as "CQL" or "CQLParser" (maybe others) into the internal documentation (important to geotools developer). On the other hand Demo/intro and the user docs should talk about "CQL" as language (consistent with OGC). I lost something? On Friday 23 February 2007 18:25, Jody Garnett wrote: > Cool let me just confirm my thinking with Mauricio then. > > Mauricio - I like CQL a lot and plan to use it in all the sample code. > As such users are > going to be using it everywhere. A year from now most won't actually > know what > a FilterFactory is ... because they never will of used it. > > As such I would like to pay attention to what the sample code looks > like, right down > to number of keypresses. > > And we make the decision on what to call CQLParser based on porting > some filter examples into the demo/intro and the user docs? Just a couple > of pages should do the trick. > > Cheers, > Jody > > > Hi Jody, > > > > On Friday 23 February 2007 01:41, Jody Garnett wrote: > >> Sorry for the delay Gabriel ... > > > > no need to apologize > > > >> a lot of your patch was directed at > >> Expr. Is that file still around? trunk says no ... > > > > Correct, trunk is ok, I've already fixed the issues with functions and > > the like a time ago, and Expr functionality in trunk is directly > > incorporated in FilterFactoryImpl. The patch was mainly a backport of the > > funciton finder on trunk as an inner class for Expr in 2.3.x, since 2.3.x > > was not creating functions at all. > > > >> Right now cql is commented out of the build; what needs to happen for it > >> to be brought into the build, and then supported? > > > > Guess just changing the name of FilterBuilder to CQL as you suggested. > > Mauricio would be happier with CQLParser, but not a great deal anyway. > > > > So watever of the two seems better we can make the change and move the > > module to plugin asap. > > > > cheers, > > > > Gabriel > > > >> Jody > >> > >>> Hi all, > >>> > >>> I'm being asked by Andrea to back port the CQL module from trunk to > >>> 2.3.x so we can use it on GeoServer 1.5.x > >>> > >>> So I went ahead and did it on my box. Now, I had to fill a couple holes > >>> in Expr.java in order to actually create functions, and had to add > >>> boolean and date literal types for LiteralExpression. > >>> > >>> Attached are the patches that make the trick. Applying them on my box > >>> and running mvn clean install from the root pom works just fine. > >>> > >>> Please review as I'm waiting for the go ahead or not to commit this > >>> changes and upload the cql module on trunk. > >>> > >>> Cheers, > >>> > >>> Gabriel -- Mauricio Pazos Axios Engineering www.axios.es tel-:+34 94 441 63 84 fax: +34-94 441 64 90 |
From: Jody G. <jga...@re...> - 2007-02-26 19:15:39
|
Victor Mauricio Pazos wrote: > Hi Jody, I am not sure about if I understand exactly your question. But if the > following code: > > //create the filter > filter =filterFactory.createCompareFilter(CompareFilter.COMPARE_GREATER_THAN); > FeatureType featureType = features.getFeatures().getSchema(); > filter.addLeftValue(filterFactory.createAttributeExpression("POP_2000")); > filter.addRightValue(filterFactory.createLiteralExpression(100000)); > > //count filtered features > col = features.getFeatures(filter); > > it is going to replace by a nicer code using CQL like: > > col = features.getFeatures("POP_2000 > 100000"); > > I see the filters creation problems will be hidden, then the name of modules > responsible of creation will be part of the internal behavior, and we only > must take into account the new class name (currently named FilterBuilder) > as "CQL" or "CQLParser" (maybe others) into the internal documentation > (important to geotools developer). On the other hand Demo/intro and the user > docs should talk about "CQL" as language (consistent with OGC). > > I lost something? > Well what we lost was your input on the DataAccess API - so your example is not going to happen just now. Let's try this one: // Option 1: CQL is a utility class with static method using default factory col = features.getFeatures( CQL.filter( "POP_2000 > 100000" ) ); // Option 2: Use with your own FilterFactory CQL cql = new CQL( filterFactory ); col = features.getFeatures( cql.parse( "POP_2000 > 10000" ) ); If you want we can write up a proposal for FeatureSource.features( String query, String queryLanguage ) again ... I would like it so we can support SQL as in Gabriels community schema branch .... ie. source.features( sql, "SFSQL" ); Jody |
From: Andrea A. <aa...@op...> - 2007-02-27 10:56:54
|
Jody Garnett ha scritto: > If you want we can write up a proposal for FeatureSource.features( > String query, String queryLanguage ) again ... I would like > it so we can support SQL as in Gabriels community schema branch .... ie. > source.features( sql, "SFSQL" ); So, the idea is to allow JDBC source to use SQL specific queries, leveraging all dialect specific for a particular database, that is, things we cannot encode in an OGC filter. Wondering, would we loose the ability to mix queries like this? Now some parts of Geotools do mix separate queries into one (see mapLayer definition query and renderer adding a bbox filter and/or the SLD filter to it). Anyways, I see the interest, maybe limited to data serving instead of rendering. Cheers Andrea |
From: Victor M. P. <mau...@ax...> - 2007-02-27 10:34:23
|
Ok, then you are right. I think that using CQL as utility is better option because it hides the implementation (the "new" statement) then we resolve future maintenance problems. I only would suggest a bit change in the protocol signatures thinking in legibility and flexibility: col = features.getFeatures( CQL.toFilter( "POP_2000 > 100000" ) ); col = features.getFeatures( CQL.toFilter( "POP_2000 > 100000", filterFactory) ); About, the a proposal for FeatureSource.features( String query, String queryLanguage ) and source.features( sql, "SFSQL" ) are good utilities but I agree that they could be developed later. Cheers -- Mauricio Pazos Axios Engineering www.axios.es On Monday 26 February 2007 20:15, Jody Garnett wrote: > Well what we lost was your input on the DataAccess API - so your example > is not going to happen just now. > > Let's try this one: > > // Option 1: CQL is a utility class with static method using default > factory > col = features.getFeatures( CQL.filter( "POP_2000 > 100000" ) ); > > // Option 2: Use with your own FilterFactory > CQL cql = new CQL( filterFactory ); > col = features.getFeatures( cql.parse( "POP_2000 > 10000" ) ); > > If you want we can write up a proposal for FeatureSource.features( > String query, String queryLanguage ) again ... I would like > it so we can support SQL as in Gabriels community schema branch .... ie. > source.features( sql, "SFSQL" ); > > Jody |
From: Jody G. <jga...@re...> - 2007-02-27 18:39:00
|
Victor Mauricio Pazos wrote: > Ok, then you are right. I think that using CQL as utility is better option > because it hides the implementation (the "new" statement) then we resolve > future maintenance problems. > > I only would suggest a bit change in the protocol signatures thinking in > legibility and flexibility: > > col = features.getFeatures( CQL.toFilter( "POP_2000 > 100000" ) ); > col = features.getFeatures( CQL.toFilter( "POP_2000 > 100000", > filterFactory) ); > Cool! Oh and about the module maintainer request; I would be happy to recommend you as a module maintainer for main (so you can continue to be the authority on the CQL stuff). My response was more based on the need for CQL then anything with respect to abilities/trust :-D Jody |
From: Victor M. P. <mau...@ax...> - 2007-03-01 10:40:48
|
:-D, I can imagine your intentions :-D. Well, thanks On Tuesday 27 February 2007 19:37, Jody Garnett wrote: > Cool! Oh and about the module maintainer request; I would be happy to > recommend you as a module maintainer > for main (so you can continue to be the authority on the CQL stuff). My > response was more based on the need for > CQL then anything with respect to abilities/trust :-D -- Mauricio Pazos Axios Engineering www.axios.es tel-:+34 94 441 63 84 fax: +34-94 441 64 90 |