[OpenLayers-Dev] Improvements proposal : make Geoserver functions available in OL filter

Ivan Grcic igrcic at gmail.com
Thu Feb 10 14:02:10 EST 2011


Hi Tim, thanks for the feedback.



On Thu, Feb 10, 2011 at 6:54 PM, Tim Schaub <tschaub at opengeo.org> wrote:
> I like the idea.  I've been wanting to implement something similar. Ideally
> we could serialize/deserialize with the CQL format and the Filter format.
Yes, I saw recent work about CQL format
(http://trac.osgeo.org/openlayers/ticket/2522). It would be nice to
also include it for the Functions.

>  And it would be nice to consider a way to evaluate filters with custom
> functions on the client as well.  I think what we really need is better
> expression support in general.
>
> I haven't looked at your patch yet, but I like the sound of it.
Maybe it would help if I actually attach it :)

Regards,
Ivan

>
> Tim
>
> On 2/10/11 10:25 AM, Ivan Grcic wrote:
>>
>> Dear devs,
>>
>> we would like to make an improvement for OL Filter, that would add the
>> possibility to create Geoserver vendor ogc:Function filter elements
>> inside existing spatial filter elements.
>>
>> As you probably already know,  GS has quite a lot of these handy
>> functions by now, so it would be also useful to have them available in
>> OL (
>> http://docs.geoserver.org/2.0.x/en/user/filter/function_reference.html
>> )
>>
>> Recently GS filter was improved by GeoSolutions with even more
>> advanced filter options that enable us to make advanced queries that
>> combine different layers on Geoserver (you can read more about it on
>>
>> http://geo-solutions.blogspot.com/2011/02/developer-corner-cross-layer-filtering.html)
>>
>>
>> I made some initial patch that achieves desired behavior, and I opened
>> ticket for it (http://trac.osgeo.org/openlayers/ticket/3053)
>>
>> As I see it now, spatial filter elements accept several arguments:
>> type , property, value (Geometry or BBOX), distance and distance
>> units.
>> With this patch it will be possible to define additional elements
>> functionName and functionParams, which would be used instead of
>> filter.value element to create necessary Function elements.
>>
>> In OpenLayers.Format.Filter.v1 additional writers Function elements
>> was added. For each Function element two parameters have to be set:
>> string functionName  and array functionParams. functionParams can
>> contain various number of parameters - Literals, or another Function
>> elements, allowing us to create complex filters  with nested Function
>> elements.
>>
>> In OpenLayers.Format.Filter.v1_0_0  and
>> OpenLayers.Format.Filter.v1_1_1 writeSpatial function check was added
>> that looks if functionName  was supplied instead of value, and writes
>> function node for us.
>>
>> (OpenLayers.Filter.Spatial needs to be modified I guess also to add
>> additional elements there)
>>
>> So, id like to hear some comments/opinions about it, if i'm heading in
>> the right directions? Should I maybe define
>> functionName/functionParams inside filter.value?
>>
>> Any suggestions are more than welcomed!
>>
>> Regards,
>> Ivan
>>
>>
>
>
> --
> Tim Schaub
> OpenGeo - http://opengeo.org
> Expert service straight from the developers.
> _______________________________________________
> Dev mailing list
> Dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-dev
>



-- 
Ivan Grcic


More information about the Dev mailing list